[mod_python] mod_python on RHEL5

Graham Dumpleton graham.dumpleton at gmail.com
Thu Mar 20 17:30:07 EDT 2008


See:

  http://issues.apache.org/jira/browse/MODPYTHON-225

Find the 'envvars' file in the same directory as httpd executable for
your Apache and set PYTHONHOME environment variable to '/usr/local'
and export it.

  PYTHONHOME=/usr/local
  export PYTHONHOME

It is the same issues as described in section 'Multiple Python Versions' of:

  http://code.google.com/p/modwsgi/wiki/InstallationIssues

for mod_wsgi except that mod_wsgi has a proper directive to allow
location to be overridden where as this is only described for
mod_python to be done in referenced issues above.

Graham

On 21/03/2008, Emyr Thomas <emyr at teuluthomas.com> wrote:
> 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 \
>     --with-python-src=/usr/local/src/Python-2.4.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:
>  /usr/sbin/suexec)
>  [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
>  mod_python.apache.\n
>  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',
>  '/usr/lib/python2.4/site-packages/Numeric',
>  '/usr/lib/python2.4/site-packages/gtk-2.0']".
>  [Thu Mar 20 16:40:25 2008] [error] get_interpreter: no interpreter
>  callback found.
>  [Thu Mar 20 16:40:25 2008] [error] [client 192.168.201.30]
>  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!
>
>  Emyr
>  _______________________________________________
>  Mod_python mailing list
>  Mod_python at modpython.org
>  http://mailman.modpython.org/mailman/listinfo/mod_python
>


More information about the Mod_python mailing list