[mod_python] mod_python on RHEL5

Emyr Thomas emyr at teuluthomas.com
Thu Mar 20 12:43:15 EDT 2008

RedHat Enterprise Linux 5.1
Apache 2.2.3 (system installed)
Python 2.4.4 (custom install in /usr/locoal)
mod_python 3.3.1

I know you mod_python experts are probably sick and tired of hearing
these kinds of questions, but I'm at my wit's end!
I've seen a number of posts from people with very similar problems,
but having tried a number of "solutions", none of them seem to work!

I did a make altinstall of python, then I configured mod_python like so:

./configure \
    --with-apxs=/usr/sbin/apxs \
    --with-python=/usr/local/bin/python2.4 \

After installing mod_python and configuring apache, I try some tests
but keep getting a 500 Internal Server Error. apache's error log shows
the following:

[Thu Mar 20 16:39:50 2008] [notice] suEXEC mechanism enabled (wrapper:
[Thu Mar 20 16:39:50 2008] [notice] Digest: generating secret for
digest authentication ...
[Thu Mar 20 16:39:50 2008] [notice] Digest: done
[Thu Mar 20 16:39:50 2008] [notice] mod_python: Creating 8 session
mutexes based on 256 max processes and 0 max threads.
[Thu Mar 20 16:39:50 2008] [notice] mod_python: using mutex_directory /tmp
[Thu Mar 20 16:39:50 2008] [notice] Apache/2.2.3 (Red Hat) configured
-- resuming normal operations

[Thu Mar 20 16:40:25 2008] [error] make_obcallback: could not import
ImportError: No module named mod_python.apache
[Thu Mar 20 16:40:25 2008] [error] make_obcallback: Python path being
used "['/usr/lib/python24.zip', '/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2', '/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload', '/usr/lib/python2.4/site-packages',
[Thu Mar 20 16:40:25 2008] [error] get_interpreter: no interpreter
callback found.
[Thu Mar 20 16:40:25 2008] [error] [client]
python_handler: Can't get/create interpreter.

Why does the line "Python path being used" show /usr/lib/XXX instead
of /usr/local/lib ?

I've tried switching SELinux off (it's on by default in RHEL5), but
still the same error.

A thousand thanks for anyone who can help me figure this out before I go bald!


More information about the Mod_python mailing list