mod_python: what's going on here?

Robert J. Hansen cipherpunk at gmail.com
Mon Sep 5 00:38:48 EDT 2005


I'm not entirely certain comp.lang.python is the proper newsgroup for
mod_python questions, but "comp.lang.python.web" doesn't seem to exist,
so... my apologies in advance if this is considered off-topic.

I'm attempting to get mod_python 3.1.4/python 2.4.1 working on Apache
2.0.54 running under OS X.  Apache was compiled from source with a
simple

/configure --enable-so --with-mpm=worker

... followed by the make/make install dance.  mod_python was almost as
simple:

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

... followed by the requisite dance.

At this point, all's well.  The following bits were added to
httpd.conf:

LoadModule python_module /usr/local/apache2/modules/mod_python.so
<Directory "/usr/local/apache2/htdocs/test">
       AddHandler mod_python .py
       PythonHandler mptest
       PythonDebug on
</Directory>

... one apachectl restart later, Apache was running fine and serving
pages.  The version string at the bottom of some static pages listed
mod_python as being present, so I reckoned that meant it was all
installed all right.  However, any attempt to serve a mod_python
script, mptest.py, from the test subdirectory results in a 500 Internal
Server Error.  Nothing gets written to error_log, but access_log
confirms the 500 was sent.

Does anyone have any experience with mod_python on OS X/Apache
environments?  Can anyone shed some light on 500s that don't leave
traces in the error logs, or what precise incantation I need to make
mod_python start serving up scripts?

Also, if this is not appropriate for this group, does anyone know of a
Python group for which this is more appropriate?




More information about the Python-list mailing list