|
Jacob Kaplan-Moss
jacob at jacobian.org
Tue Sep 7 14:27:24 EDT 2004
Hey all --
I'm trying to get mod_python working on my PowerBook, and I'm running
into a problem that's leaving me stumped. I installed Apache2 from
source, and built mod_python by doing:
- ./configure --prefix=/usr/local/apache2
--with-apxs=/usr/local/apache2/bin/apxs
- Edit src/Makefile; add "OPT=-DEAPI" (line 28)
- make && make install
I'm using the stock Python (2.3), and this seems to work;
/usr/local/apache2/bin/apachectl start works, and I see:
[Tue Sep 07 13:15:21 2004] [notice] Apache/2.0.50 (Unix)
mod_python/3.1.3
Python/2.3 configured -- resuming normal operations
in my Apache error log.
However, any time I try to use mod_python, I get an internal service
error, and the error log contains only this cryptic line:
[Tue Sep 07 13:15:37 2004] [warn] Cannot get media type from
'cgi-script'
Right now, I'm doing the bare basics; here's the relevant section of my
httpd.conf:
<Directory "/Users/jacob/Sites/PyTest">
AddHandler mod_python .py
PythonHandler test
PythonDebug On
</Directory>
and test.py contains:
from mod_python import apache
def handler(req):
req.content_type = "text/plain"
req.wite("It worked")
return apache.OK
Does anyone have any idea what's going on?
Thanks a bunch,
Jacob
|