[HCoop-Help] [HCoop-Misc -> Help] using mod_python

Benjamin Hell beni at hcoop.net
Thu May 22 09:03:51 EDT 2008


docelic at hcoop.net wrote:
> On Thu, May 22, 2008 at 12:17:00PM +0200, Christian Boesgaard wrote:
>> As I am no expert on these matters I would still be happy if someone
>> could point me in the right direction. Like how do I run mod_python as
>> a daemon?
> 
> I hope others who have done this for themselves and are on the -help
> list can chime in with specific information about it.

I have an apache instance with mod_python running for
http://www.siebengang.net/ .

Get a working apache/mod_python installation (in your home dir), and
set up a startup procedure, so that cron starts your daemon when
mire reboots. Take a cron job like

@reboot   run-in-pagsh --fg ~/apache2/bin/apachectl start

as a starting point. Your httpd must be configured so that it
listens on a dedicated port, the standard port 80 won't work. There
used to be a hcoop procedure to get access to a free port. I got
8880 (and 8881 for another httpd) and have this in my httpd.conf:

Listen 8880

I just discovered the following lines in my httpd.conf, too. I think
they are necessary for mod_python to function properly (my
mod_python and some more modules are installed in ~/python/mod_python):

<IfModule mod_python.c>
    PythonPath "sys.path + ['/afs/hcoop.net/user/b/be/beni/python']"
</IfModule

Next you need "port forwarding" of http requests for your domain to
your own httpd (so that you don't need to use addresses like
http://www.siebengang.net:8880/index.html, but
http://www.siebengang.net/index.html gets "mapped" to port 8880). In
the domtool setup for me this looks like

domain "siebengang.net" with
  (* NS/DNS/Mail stuff omitted *)
    web "www" with
    proxyPass "/" "http://localhost:8880/";
    proxyPassReverse "/" "http://localhost:8880/";
  end;
end;

That should be about all you need...

You may be interested in an AFS related problem I have encountered
and not been able to solve yet:
https://bugzilla.hcoop.net/show_bug.cgi?id=291


Good luck! Contact me if you run into problems...

Beni



More information about the HCoop-Help mailing list