|
Linscombe, Jason
LinscombeJ at cmalliance.org
Thu May 24 09:02:11 EST 2001
Hi List,
I'm trying to run mod_python over apache and could use some help setting
this up. Here is my setup...
Apache-1.3.14-6
Python-2.0-6
mod_python-2.7.1-3
Distro: SuSE 7.1 Installed the above with RPM
Here is the python stuff in my httpd.conf
-----------------------------------------------------------------
<IfDefine PYTHON>
LoadModule python_module /usr/lib/apache/mod_python.so
</IfDefine>
<IfDefine PYTHON>
AddModule mod_python.c
</IfDefine>
<Directory /usr/local/httpd/htdocs/test>
AddHandler python-program .py
PythonHandler mptest
PythonDebug On
</Directory>
-----------------------------------------------------------------
And I have this in a file called /usr/local/httpd/htdocs/test/mptest.py
-----------------------------------------------------------------
from mod_python import apache
def handler(req):
req.send_http_header()
req.write("Hello World!")
return apache.OK
-----------------------------------------------------------------
I have checked all file permissions and everything seems to be OK. All of
the above was either default in my httpd.conf or what I found in the
"Testing" page on the documentation. The problem I'm having is with the
above, I try to start apache and I get the following error:
FAILED: See /var/log/httpd/rcapache.log for details
here is the rcapache.log file...
-----------------------------------------------------------------
Syntax error on line 1634 of /etc/httpd/httpd.conf
Invalid command 'PythonHandler', perhaps mis-spelled or defined by a module
not included in the server configuration.
-----------------------------------------------------------------
Question: is this mptest.py file necessary for running python scripts over
the web server or is this simply a test? Being a python newbie, I don't
really know what to do next. Thanks in advance for any help!
jason
|