28 May 2008

Getting mod_python.publisher work via .htaccess

Being able to use a ".htaccess" file, was however dependent on your directory at least allowing overriding of "FileInfo" aspects of the configuration. If however an Apache administrator will not allow this, you will not have any choice but to have the ability to use mod_python in a directory enabled in the global configuration."
http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking

So, add AT LEAST the following lines to your httpd.conf

AllowOverride FileInfo

And to your .htaccess:

SetHandler mod_python

PythonHandler mod_python.publisher


This was tested in the following environment:
Apache/2.2.3 (testvw) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch7.56.200712100724 mod_ssl/2.2.3 OpenSSL/0.9.8c Server at 10.200.20.10 Port 80

Some useful links:
http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride
http://httpd.apache.org/docs/1.3/mod/mod_mime.html#sethandler
http://missysadmin.com/2007/11/21/installing-mod_python/
http://www.dscpl.com.au/wiki/ModPython/Articles/SetHandlerVersusAddHandler
http://www.dscpl.com.au/wiki/ModPython/Articles/GettingModPythonWorking

Some useful commands:
tail -f /var/log/apache2/error.log