[mod_python] What's the deal with _apachemodule?

Markus Demleitner msdemlei at cl.uni-heidelberg.de
Sat Apr 13 18:15:47 EST 2002


Hi list,

I'm trying to compile modpython 2.7.7 together with apache 1.3.23
and python 2.2 -- which works after some fiddling with the libs
python was linked to.  I know that the prerequisites don't state 
that 2.2 is supported, but I couldn't see how my problem could
be linked with the python version.

When I'm actually trying to let some test script run, I get
Traceback (most recent call last):
  File "/home/unimut/www/cgi-bin/modpython.py", line 4, in ?
    from mod_python import apache
  File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", line 55, in ?
    import _apache
ImportError: No module named _apache
in the server log.

That's fair enough, because there is no _apachemodule.so in
.../site-packages/mod_python, or anywhere else on the
python path.

Now, I say to myself, it's got be somewhere and check the
source directory -- lo and behold, there's _apachemodule.o
all right.  So, I link it to a dso -- and only get an undefined
symbol MpServer_Type.  That's in one of the .o's in .../src,
so I simply link all .o together.

The resulting _apachemodule.so says:
  File "/home/unimut/www/cgi-bin/modpython.py", line 4, in ?
    from mod_python import apache
  File "/usr/local/lib/python2.2/site-packages/mod_python/apache.py", line 55, in ?
    import _apache
ImportError: /usr/local/lib/python2.2/site-packages/mod_python/_apachemodule.so: undefined symbol: ap_log_error

This symbol is imported by _apachemodule.o itself -- so it's
unlikely that I have overlinked.

At this point I gave up, thinking I must be doing something extraordinarily
stupid.

So, what's the deal?  _apachemodule.so isn't mentioned anywhere in the
source tree, but it seems to be required to satisfy the import _apache
statement.  What might the solution to this riddle be?

        Markus



More information about the Mod_python mailing list