[mod_python] Configuring mod_python via reverse proxy

Jim Gallacher jpg at jgassociates.ca
Wed Dec 14 15:23:46 EST 2005


Roberto C. Sanchez wrote:
> Jorey Bump wrote:
> 
>>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.
> 
> 
> The DocumentRoot is $HOME/public_html, which is also accessible via
> user_dir from the main apache instance.  Is that a problem?
> 
> Basically, for Python Server Pages I get the source displayed in the
> browser.  For .py files using the publisher handler, I get either the
> source downloaded (in the case of just the .py file, e.g.,
> http://foo/form.py) or a 404, (in the case of http://foo/form.py/email).
>  Of course, I am referring to the form example here:
> http://www.modpython.org/live/current/doc-html/tut-pub.html
> 
> -Roberto

This maybe too obvious but is AllowOverride perhapas set to None such 
that your .htaccess file is not getting processed?

Jim



More information about the Mod_python mailing list