Revision of mod_python from Thu, 06/19/2008 - 13:49
The revisions let you track differences between multiple versions of a post.
Configure, build and install the module:
./configure --with-apxs=/usr/local/apache2/bin/apxs
make
make installEdit /usr/local/apache2/conf/httpd.conf and add:
LoadModule python_module /usr/local/apache2/modules/mod_python.soRestart Apache:
svc -t /service/apacheAnd about 10 seconds later, confirm that it is running:
svstat /service/apache<strong>Testing mod_python</strong>
Edit /usr/local/apache2/conf/httpd.conf and add:
<Directory /usr/local/apache2/htdocs/python_test>
AddHandler mod_python .py
PythonHandler mptest
PythonDebug On
</Directory>Create the test directory:
mkdir /usr/local/apache2/htdocs/python_testThen create a test file /usr/local/apache2/htdocs/python_test/mptest.py with these contents (watch the indenting - it's important!):
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
req.write("Hello World!")
return apache.OK
Restart Apache:
svc -t /service/apacheThen load http://<yourserver>/python_test/mptest.py in your web browser. If it works, delete the testing stuff you just added. If it doesn't work, <A HREF=">good luck!"
- Log in to post comments