[mod_python] mptest.py is displayed, not interpreted

Ken Johnson KJohnson at eclypse.org
Thu Jul 29 18:22:46 EDT 2004


Hello,
 
I am trying to configure mod_python for the first time.
After following the installation and testing instructions
to the best of my knowledge, I find that mptest.py is
displayed instead of interpreted.

I have reviewed the installation chapter.  A prowl through 
similar reports in the mail archives did not seem to help.
A pointer to the relevent documentation would be gladly
accepted.

The make and make install for httpd and for mod_python seemed
to complete successfully.

System: Red Hat 8.0, kernel 2.4.20-28.8

Status info from the server says:
 
Apache/2.0.50 (Unix) mod_python/3.1.3 Python/2.2.1 Server at 192.168.1.8
Port 8081 

Pointing my browser at http://192.168.1.8:8081/py-test/mptest.py
displays the contents of modules/py-test/mptest.py.

(mptest.py is as shown from the Install documentation,
except for a change to the quoted string ("Hello World!"))


logs/error_log shows:

[Thu Jul 29 16:31:41 2004] [notice] Apache/2.0.50 (Unix) mod_python/3.1.3
Python
/2.2.1 configured -- resuming normal operations

which looks to me like a success message.


Changes to conf/httpd.conf for mod_python were:

LoadModule python_module modules/mod_python.so

# Directory for basic test of mod_python
<Directory "/usr/local/apache_2.0.50/htdocs/test>
    AddHandler mod_python .py
    PythonHandler mptest
    PythonDebug On
</Directory>


Also tried:

# Directory for basic test of mod_python
<Directory "/usr/local/apache_2.0.50/htdocs/test>
    AllowOverride FileInfo
    AddHandler mod_python .py
    PythonHandler mptest
    PythonDebug On
</Directory>

with the same result.

>From the activity on this list, it appears that mod_python must
be working for many people, who must have been able to move
past this roadblock.  I confess to being an Apache novice;
if there is an aspect of Apache configuration which is 
implied but not specifically stated then I have probably
missed it.

Thanks in advance for your helpful responses,

Ken Johnson




More information about the Mod_python mailing list