[mod_python] Configuring mod_python via reverse proxy

Jorey Bump list at joreybump.com
Wed Dec 14 10:32:02 EST 2005

Roberto C. Sanchez wrote:

> I have a modified apache2ctl in $HOME/apache2/bin, which starts it like
> this:
> case $ARGV in
> start|stop|restart|graceful)
>     $HTTPD -d $HOME/apache2 -f $HOME/apache2/conf/apache2.conf -k $ARGV
>     ERROR=$?
>     ;;
> In $HOME/public_html/.htaccess, I have:
> <IfModule mod_python.c>
> # Enable mod_python Python Server Pages
>   AddHandler mod_python .psp .psp_
>   PythonHandler mod_python.psp
>   PythonDebug On
> </IfModule>
> I use the IfModule directive so that access to my home directory via
> ~roberto doesn't cause the real Aapche server on port 80 to barf since I
> don't have mod_python enabled in it at all.  The one I am starting from
> within $HOME is on port 8080.

If you are starting apache with a dedicated conf file, specify a 
DocumentRoot within it that isn't shared with the main instance to 
prevent conflicts or security leaks (does the main instance of apache 
show your python code as text?). In addition, try to do your 
configuration in a Directory container in the custom conf file, at least 
until you get everything working. Start with the mptest example. 
Gradually alter your configuration from a working base, so you can 
determine which change is causing problems.

More information about the Mod_python mailing list