[mod_python] Fwd: mod python configuration problem

Alexandre F. Santos ochipepe at gmx.net
Wed Jul 13 14:11:53 EDT 2005


I would like to use mod_python but I'm having problems getting it to work. I
know you hate to answear newbie questions, but please note:

- I managed to convince an admin to install mod_python on his server, and so
far he has been cooperative. But still, I don't have previleged access to
the server, and must ask his help to get mod_python to work.

- I have read a bit of documentation on mod_python, and also the nice
http://www.dscpl.com.au/articles/modpython-001.html tutorial. But I had no
luck so far.

  Here are the specs I could gather about the server:

Python 2.3.5
mod_python 3.1.3
Apache server handler API 2.0 (20020903)

Mod_python shows up in the apache configuration (as seen by phpinfo()). I
asked the admin to do the test recommended in the tutorial to identify
mod_python and send me the output:
# python
Python 2.3.5 (#2, May  4 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mod_python.psp
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/lib/python2.3/site-packages/mod_python/psp.py", line 20, in ?
    import apache, Session, util, _psp
  File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 28, in
    import _apache
ImportError: No module named _apache

So mod_python 3.1.3 seems indeed to be installed and working.

I created a home/xp/ folder where I put a hello.txt file and verifyed that I
could access it via the web.

I then created there an .htaccess file:
AddHandler python-program .py
PythonHandler mptest
PythonDebug On

and a mptest.py file:
>from mod_python import apache

def handler(req):
    req.content_type = 'text/plain'
    return apache.OK

Going for the /xp/mptest.py file with my browser yielded the following:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable
to complete your request.

Please contact the server administrator, [no address given] and inform them
of the time the error occurred, and anything you might have done that may
have caused the error.

More information about this error may be available in the server error log.

Now of course I don't have access to the server error log, but before I
contact the admin, could you give me some indications about what could be
wrong and what would be the best approach to address this issue?



GMX DSL = Maximale Leistung zum minimalen Preis!
2000 MB nur 2,99, Flatrate ab 4,99 Euro/Monat: http://www.gmx.net/de/go/dsl

More information about the Mod_python mailing list