mod_python error. Webpage displays .py source code
703653May 27 2009 — edited May 27 2009Hello
I'm new to Python and I have a problem with mod_python. Firefox webpage displays source code of .py file instead of result. Could any one help me with this issue?
My versions are: RHEL 5, Oracle 10g, Python 2.6, mod_python 2, Apache 2.2
here is httpd.conf file's contents:
<Directory /usr/local/apache/htdocs/modules>
Options Indexes FollowSymLinks Multiviews
AllowOverride None
Order allow,deny
allow from all
AddHandler python-program .py
PythonHandler or1
PythonDebug On
</Directory>
and that's my Python source code (or1.py):
from mod_python import apache
def handler(rep)
req.content_type = 'text/plain'
req.write('Hello World')
return apache.OK