HonorGod
asked on
Why does the mptest.py source get shown instead of executed?
Apache/2.2.11 (Win32) mod_python/3.3.1 Python/2.5.2
The URL I tried using was: http://localhost/test/mptest.py
httpd.conf directives:
-------------------------- ---------- ----
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdoc s"
<Directory /test>
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>
-------------------------- ---------- ----
Under .../htdocs, I have "test" as a directory, containing this file:
-------------------------- ---------- ----
from mod_python import apache
def handler( req ) :
req.content_type = 'text/plain'
req.write( "Hello World!" )
return apache.OK
-------------------------- ---------- ----
I followed the installation instructions found here:
http://www.modpython.org/live/current/doc-html/installation.html
and testing instructions found here:
http://www.modpython.org/live/current/doc-html/inst-testing.html
and the troubleshooting instructions found here:
http://www.modpython.org/live/current/doc-html/inst-trouble.html
As part of the troubleshooting, I added this directive to my httpd.conf:
-------------------------- ---------- ----
<Location /mpinfo>
SetHandler mod_python
PythonHandler mod_python.testhandler
</Location>
-------------------------- ---------- ----
I was able to access that page using: http://localhost/mpinfo
and it showed the page in all its glory.
What am I missing?
The URL I tried using was: http://localhost/test/mptest.py
httpd.conf directives:
--------------------------
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdoc
<Directory /test>
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>
--------------------------
Under .../htdocs, I have "test" as a directory, containing this file:
--------------------------
from mod_python import apache
def handler( req ) :
req.content_type = 'text/plain'
req.write( "Hello World!" )
return apache.OK
--------------------------
I followed the installation instructions found here:
http://www.modpython.org/live/current/doc-html/installation.html
and testing instructions found here:
http://www.modpython.org/live/current/doc-html/inst-testing.html
and the troubleshooting instructions found here:
http://www.modpython.org/live/current/doc-html/inst-trouble.html
As part of the troubleshooting, I added this directive to my httpd.conf:
--------------------------
<Location /mpinfo>
SetHandler mod_python
PythonHandler mod_python.testhandler
</Location>
--------------------------
I was able to access that page using: http://localhost/mpinfo
and it showed the page in all its glory.
What am I missing?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.