[mod_python] mod_python not working (Newbie-alert!)

Dianne Chen diana_chen23 at yahoo.com
Mon May 9 12:13:50 EDT 2005

Hi all-

I am new to mod_python and I am having problems
getting a simplest example to work. I have found
another earlier post in archives, but he was having
error message. I am getting no error message, but must
have simple mistake. Here are my facts:

Apache 2.0
mod_python 2.7 (as installed)
python 2.2 (as installed)
Using python2.3 installed in /usr/local/bin for
running applications

httpd.conf mods:
LoadModule python_module modules/mod_python.so

<Directory /var/www/html/apachetest>
  AddHandler mod_python .py
  PythonHandler mptest
  PythonDebug On

I have created a link in /var/www/html directory
called "apachetest" which points to a directory
/usr/local/testdir. Testdir contains a file called
mptest.py.  The contents of mptest.py are suggested
from docs:
from mod_python import apache

def handler(req):
    req.write("Hello World!")
    return apache.OK

When I use following URL, I get a file listing - it
looks like apache has no idea that a .py file needs to
be executed and not just listed:


Can anyone provide a pointer where I have gone wrong?


Yahoo! Mail
Stay connected, organized, and protected. Take the tour:

More information about the Mod_python mailing list