Prerequsitation:
1.Apache v2.2.4
2.Python2.4
3.mod_python3.3.1 for apache2.2 and python2.4
Configure Steps:
1.Add below in the apache/conf/http.conf(first check the mod_python.so whether exists in apache/modelus)
LoadModule python_module modules/mod_python.so
2.Configure the http.conf,add below(Confirm that you have configured web root for c:\work\wwwroot):
Just like this:DocumentRoot "C:/Work/wwwroot"
<directory python="" wwwroot="" work=""></directory>/<directory python="" wwwroot="" work=""></directory>
AddHandler mod_python .py
#PythonHandler mptest
PythonHandler mod_python.publisher
PythonDebug On
/
3.Put down a py script(aaron.py) in C:/Work/wwwroot/python
from mod_python import apache
def handler(req):
req.content_type = 'text/plain'
req.write("Dynamic language python!")
return apache.OK
4.Visit the web by:
http://localhost/python/aaron.py/handler
see done or not
Appendix A Reference:
http://www.modpython.org/live/current/doc-html/inst-testing.html