Wednesday, October 7, 2009

Install Python on Apache in Centos 5.4

The first thing, you need the Mod_python:

sudo yum install mod_python


After that, you need to configure Apache by modifying the configuration file:

LoadModule python_module libexec/mod_python.so



AddHandler mod_python .py .psp
PythonHandler mptest
PythonDebug On


where mptest is the python file you are trying to run. The .psp is for python server page

Restart the Apache, and now you can create your web page using python.

No comments: