I configured apache to execute python scripts using mod_python
<br>handler. I followed below mentioned steps to configure apache.
<br>
<br>1. In http.conf I added
<br>
<br>  <Directory "D:/softwares/Apache2.2/htdocs">
<br>  AddHandler mod_python .py
<br>  PythonHandler mptest
<br>  PythonDebug On
<br>  </Directory>
<br>
<br>2. Then I added the line "LoadModule python_module modules/
<br>mod_python.so" to http.conf.
<br>
<br>Then I tried execute the python script mentioned below from browser.
<br>
<br>from mod_python import apache
<br>def handler(req):
<br>req.content_type = 'text/plain'
<br>req.write("Hello World!")
<br>return apache.OK
<br>
<br>Then I am getting the following error
<br>
<br>Traceback (most recent call last):
<br>
<br>  File "D:\softwares\Python25\Lib\site-packages\mod_python
<br>\importer.py", line 1537, in HandlerDispatch
<br>    default=default_handler, arg=req, silent=hlist.silent)
<br>
<br>  File "D:\softwares\Python25\Lib\site-packages\mod_python
<br>\importer.py", line 1202, in _process_target
<br>    module = import_module(module_name, path=path)
<br>
<br>  File "D:\softwares\Python25\Lib\site-packages\mod_python
<br>\importer.py", line 304, in import_module
<br>    return __import__(module_name, {}, {}, ['*'])
<br>
<br>ImportError: No module named mptest
<br>
<br>I am using Apache 2.2.4, python 2.5 and mod_python-3.3.1.win32-py2.5-
<br>Apache2.2.
<br>
<br>I am able to execute python scripts by configuring apache to execute
<br>the cgi scripts. But I want to execute it using mod_python as it is
<br>faster compared to cgi mode. Someone please help me on this issue.