[mod_python] configuration error

Mark McEahern marklists at mceahern.com
Tue Jul 9 12:41:27 EST 2002

Hi, I'm trying to configure mod_python with Apache.  When I run the test, I
get Internal Server Error.  Here's what I see in Apache's error_log:

[Tue Jul  9 12:10:18 2002] [notice] Apache/1.3.26 (Unix) mod_python/2.7.8
Python/2.2.1 configured -- resuming normal operations
[Tue Jul  9 12:10:18 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
make_obcallback(): could not import mod_python.apache.
make_obcallback(): could not call init.
[Tue Jul  9 12:10:46 2002] [error] [client] python_handler:
make_obcallback returned no obCallBack!

Here's how I compiled mod_python and installed it:

  ./configure --with-apxs=/usr/local/apache/bin/apxs
  sudo make install

I then edited httpd.conf, adding:

LoadModule python_module /usr/local/apache/libexec/mod_python.so


<Directory /home/.../pytest/>
  AddHandler python-program .py
  PythonHandler mptest
  PythonDebug On

This is mptest.py:

from mod_python import apache

def handler(req):
    req.write("Hello World!")
    return apache.OK

I'm running Apache 1.3.26 on Red Hat Linux 7.3.  I'm using Python 2.2.1.
mod_python installed into:


which is world readable.  All the files in mod_python are world readable.
Interestingly, the .py files are world executable, but the .pyc files are
NOT world executable--I don't think that makes a difference?

Is there something obvious I'm doing wrong in configuring Apache?

I found this thread and the threads it points to:


The problem he encountered was that mod_python was installed as
mod_python$version, which he solved by using a symbolic link.  I don't think
that's the problem I'm having.

Interestingly, if I start Apache with httpd -X, Hello World works just fine.
However, when I start Apache normally, it doesn't work, but the above dump
from error log is all I have to go on.

Any ideas?


// mark


More information about the Mod_python mailing list