mod_python error under Apache

pehr anderson pehr at pehr.net
Mon Oct 9 13:17:59 EDT 2000


Dear Hamilton, 

For getting started with mod_python,
I'd recommend trying out the RPM.
I was surprised at how quick it was
to jump into it as the RPM puts a
test .py file in /home/httpd/mod_python
and modifies your /etc/httpd/conf/httpd.conf
as needed.

Modifying the apache config files might freak some people out
so you'll probably want to try it out on a non-production box
and then look into compiling from source when you are ready to
deploy. That way you save time up front, but still get where
you are wanting to go.

	-pehr


Hamilton Link wrote:
> 
> I'm trying to set up mod_python in Apache. I've built Apache before and
> everything works fine, but this time I included mod_python amongst the
> statically linked mods (I figured I'd try that and then go back and try
> the seemingly more complicated process of building mod_python as a DSO,
> just to compare). Apache still works fine, except for mod_python.
> I RTFM'ed and did what the instructions from modpython.org said,
> modified my httpd.conf etc. but when I try to actually reference a .py
> file I get the following instead:
> 
> Mod_python error: "PythonHandler mptest"
> 
> Traceback (innermost last):
> 
>   File "/usr/lib/python1.5/site-packages/mod_python/apache.py", line
> 135, in Dispatch
>     module = import_module(module_name, req)
> 
>   File "/usr/lib/python1.5/site-packages/mod_python/apache.py", line
> 276, in import_module
>     module = __import__(module_name)
> 
> ImportError: No module named mptest
> 
> I'm new to python, so I'm not crazy about debugging apache.py -- has
> anyone had this problem or does anyone know what I f...ed up?
> 
> thanks,
> hamilton



More information about the Python-list mailing list