[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:

RHEL3.0
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
</Directory>
=====

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.send_http_header()
    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:

http://my_server/apachetest/mptest.py

Can anyone provide a pointer where I have gone wrong?

Thanks!
DC



		
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html



More information about the Mod_python mailing list