I am having issues with getting my Mod Python to work properly.
I have followed mod_python manual found here
So here is my Apache setup (I am using Virtual Hosts):
<VirtualHost *:80>
ServerName hostname
DocumentRoot "C:/Documents and Settings/username/hostname/www"
<Directory "C:/Documents and Settings/username/hostname">
DirectoryIndex index.py
AddHandler mod_python .py
PythonHandler www.index
PythonDebug On
</Directory>
</VirtualHost>
Here is my handler index.py:
from mod_python import apache
def handler(req):
req.content_type = "text\plain"
req.write("Hello World!")
return apache.OK
After setting all that up I get the following error:
ImportError: No module named www.index
NOTE: The reason I am adding www to index, is because that is what the mod_python tutorial stated:
Attempt to import a module by name myscript. (Note that if myscript was in a subdirectory of the directory where PythonHandler was specified, then the import would not work because said subdirectory would not be in the sys.path. One way around this is to use package notation, e.g. "PythonHandler subdir.myscript".)
If I use mod_python.publisher as my PythonHandler, everything works fine. Not sure what I am missing here.