Step 1:
Step 2:
Extract and place the mod_python.dll in modules sub directory where apache is installed ie: c:\program files\apache group\apache\modules
Step 3:
Modify the http.conf file, add to the Dynamic Shared Object section the following:
LoadModule python_module modules/mod_python.dll
Step 4:
Add to the ScriptAlias the following:
<Directory "<Your Document Root>/python">
AddHandler python-program .py
PythonHandler apache
PythonDebug on
</Directory>
Step 5:
Create Test file name helloworld.py store in /python directory (/python directory should be created directly under the document root ie: htdocs/python) with the following content:
from mod_python import apache
def handler(req):
req.content_type = "text/plain"
req.send_http_header()
req.write("Hello World!")
return apache.OK
Step 6:
Restart Apache and point to the newly created file, you should see the Hello World output