[mod_python] Still displaying source instead of results...

Anthony M. Saffer anthony at opensource-strategies.com
Thu Dec 2 22:07:24 EST 2004

Hello Everyone,

I asked this question a few weeks ago and didn't receive any answer aside
from "well, did you read the docs". So, before someone asks that again: yes
I did read the docs here and I have done as they've told me and it still
isn't working.

Here's my setup:

mod_python 2.7
apache 1.3
RH Linux Advanced Server (Current Version)

I followed the following procedure to install mod_python:

make install

All standard stuff...The installation process told me all was well and that
I should point add LoadModule python_module /usr/lib/apache/mod_python.so to
the LoadModule list and AddModule mod_python.c to my AddModule list since I
do use the ClearModuleList directive.

Additionally, I added the following lines to my httpd.conf file right under
the AddModule list:

AddHandler mod_python .py
PythonHandler mptest
PythonDebug On

This is ALL that the docs tell me to do and, yet, when I run the following
script I get a dump of the source. The script is not executing even though
I've gone as far as to chmod +x the script.

from mod_python import apache

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

Can anyone help me out here? I am fairly new to installing new Apache
modules and would greatly appreciate it.


More information about the Mod_python mailing list