[mod_python] Segfaults and Handler issues

Alexis Iglauer aiglauer at yahoo.com
Thu May 10 07:18:27 EST 2001


I am migrating an existing mod_python application to a new server -
which involves an entirely new installation of everything including
apache and mod_python.

The new server is running Mandrake 7.2, apache 1.3.14 [old one had
1.3.9] and mod_python 2.7.2 [old: 2.6.2].

I have had multiple (connected) problems.

One of the things I noticed is that in all the mod_python docs the
AddHandler directive is

AddHandler python-program .py

Whereas I use (also on the old, working system)

AddHandler python-program py   <---- No '.' before 'py'

If I put the '.' in, then apache never finds my handler (old and new

On the old system, everything worked once I compiled with -DEAPI (I had
no issues with threading).  On the new setup I get apache SegFaults.  I
compile as a DSO on both systems.

In trying to fix the SegFault problem, I made myself a separate Python
in /usr/local/src/Python-1.5.2 which I compiled without threads.  I
have also compiled mod_python against this non-threaded python version.
 All this has not helped.  The following things occur:

If I run 'httpd -X' (single httpd and you can see the stdout) and I try
to load my webpage in Netscape (running locally) I will sometimes get
"module '/home/slbin/stoploss/slhead' contains no 'handler'" and
sometimes "no module named re" with the error coming out of my slhead

The irritating thing is that the error messages show that I am using
libraries from my normal python installation and not my non-threaded
install.  Is there any way to force mod_python to load a python from a
certain path?

If I run httpd normally, my page(s) - I use multiple frames, each
generated by the same handler based on the URL - will load.

I have "PythonHandler slhead::handler" in my httpd.conf, and my
functions are inside slhead.py

I now know why my handler stops - I get segfaults whenever I try to
access req.connection.remote_ip.  This used to work - has the
apache/mod_python API changed?

Any ideas, especially on why httpd -X doesn't work and how to enforce a
certain python interpreter, would be most welcome.


Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices

More information about the Mod_python mailing list