[mod_python] Configuring mod_python via reverse proxy

Roberto C. Sanchez roberto at familiasanchez.net
Wed Dec 14 12:36:39 EST 2005

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:


Roberto C. Sanchez
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051214/728b664c/signature.bin

More information about the Mod_python mailing list