[mod_python] Apache 1.3.12, Python 1.6, mod_python 2.5 not playing well together

Jeff Okamoto okamoto at xfiles.intercon.hp.com
Fri Sep 29 12:49:46 EST 2000


> > <Directory />
> >     Options FollowSymLinks
> >     AllowOverride None
> > </Directory>
> > 
> > <Directory /opt/apache>
> >     AddHandler python-program .py
> >     PythonHandler mptest
> >     PythonDebug On
> > </Directory>

Some more info: if I change /opt/apache above to /test (and mptest.py is
in htdocs/test), then Apache returns the text of the file.

When it's /opt/apache, the browser returns:

Mod_python error: "PythonHandler mptest"

Traceback (most recent call last):

  File "/usr/local/lib/python1.6/site-packages/mod_python/apache.py", line 135, in Dispatch
    module = import_module(module_name, req)

  File "/usr/local/lib/python1.6/site-packages/mod_python/apache.py", line 276, in import_module
    module = __import__(module_name)

ImportError: No module named mptest

and Apache's error log says:

[Fri Sep 29 12:46:29 2000] [error] PythonHandler mptest: Traceback (most recent call last):
[Fri Sep 29 12:46:29 2000] [error] PythonHandler mptest:   File "/usr/local/lib/python1.6/site-packages/mod_python/apache.py", line 135, in Dispatch
    module = import_module(module_name, req)
[Fri Sep 29 12:46:29 2000] [error] PythonHandler mptest:   File "/usr/local/lib/python1.6/site-packages/mod_python/apache.py", line 276, in import_module
    module = __import__(module_name)
[Fri Sep 29 12:46:29 2000] [error] PythonHandler mptest: ImportError: No module named mptest

> One thing that you 
> might want to try is putting mptest.py into the same directory as apache.py,
> this ensures that it is going to be in the correct path. That might help
> narrow down the problem. Also you probably need to make sure that the file has
> read and execute permission for the apache user.

Tried all this, including setting execute permissions.  NFG.

Jeff



More information about the Mod_python mailing list