[mod_python] Cant make test work

Graham Dumpleton grahamd at dscpl.com.au
Tue Sep 19 16:53:44 EDT 2006


On 20/09/2006, at 5:19 AM, Ronald Levine wrote:

> Installed mod_python 3.2.10 into this environment
> 	OS CentOS 4 (default in the Rocks 4.1 distribution)
> 	Apache 2.0.52
> 	Python 2.3
>
> Followed the install instructions to the letter.
> However the test does not work for me. I.e., pointing my browser at
> http://localhost/mptest/mptest.py
> just returns the listing of mptest.py, but not the results of running
> it against the python interpreter.
>
> /etc/httpd/conf/httpd.conf does contain the line
> LoadModule python_module modules/mod_python.so
>
>
> and /usr/lib/httpd/modules/mod_python.so exists.
>
> /var/www/html/mptest/.htaccess does contain
> AddHandler python_module .py

It isn't 'python_module' for a start. For the version of mod_python
you are using, use:

   AddHandler mod_python .py

> PythonHandler mptest
> PythonDebug On
>
> and mptest.py contains
>
> from mod_python import apache
> def handler(req):
>    req.content_type = 'text/plain'
>    req.write("Hello World!")
>    return apache.OK
>
> I'm stuck

Try the following alternate set of instructions.

   http://www.dscpl.com.au/wiki/ModPython/Articles/ 
GettingModPythonWorking

It steps you through some of the other configuration issues you might be
missing.

Graham


More information about the Mod_python mailing list