mod_python config problem

  • Thread starter Manuel Pellecer
  • Start date
M

Manuel Pellecer

i want to use mod_python with Apache2 and i made a .htaccess in the
subdirectory where i have all my scripts:

The .htacces goes like this:

AddHandler mod_python .py

PythonHandler mptest

PythonDebug On

and I changed the main configuracion file of Apache2 like this:

#--memepelle

<Directory /var/www/cgi>

AllowOverride FileInfo

</Directory>

#memepelle--

and i made a mptest.py that goes like this:

from mod_python import apache

def handler(req):

req.content_type = "text/plain"

req.write("Hello World!")

return apache.OK

But i still have this error and i don't know why

Mod_python error: "PythonHandler mptest"

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 287,
in HandlerDispatch
log=debug)

File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 454,
in import_module
f, p, d = imp.find_module(parts, path)

ImportError: No module named mptest

Please some help!!!
 
L

Luis M. Gonzalez

Getting mod_python to work is hard because there are many things to get
into account.
Your Apache version should match the proper mod_python version, as well
as the python version amd so on...
If you are having many problems, I suggest installing Apache2Triad,
which is a package that will install everything you need (and more) all
at once.

www.apache2triad.net
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top