[mod_python] 404 error on existing file

Andre Hübner andre.huebner at gmx.de
Thu Jun 19 03:49:40 EDT 2008

Hi List,

it is my first posting to mod_python mailinglist.
I successfully solved problem with " make_obcallback: could not import 
mod_python.apache" using faq but now i need your help.
.so File was ok, but i forgot to put *py Files to site-packages/mod_python 

mod_python seems to run now. 
http://www.modpython.org/FAQ/faqw.py?req=show&file=faq02.006.htp  shows what 
i try.
I activated in httpd.conf:

<Location "/py/">
    AddHandler mod_python .py
    PythonHandler mod_python.publisher
    PythonDebug On

My File in $document-root/py/test.py:

from mod_python import apache

def handler(req):
    req.content_type = "text/plain"
    req.write("Hello World! Blarg!")
    return apache.OK

If I call this file i got apache-error 404, but called file is existing.  in 
Apache errorlog i see:

[Thu Jun 19 09:40:31 2008] [notice] mod_python (pid=18650, 
interpreter=example.com'): Importing module '/path/path/py/test.py'

If i change code of test.py to make syntaxerror without changing 
apache-setup i see in errorlog and browser the message about syntaxerror.
I cannot explain this 404 when using correct code. I just want to see "hello 
world" in browser.

I use apache 2.2.9 and mod_python 3.3.1
What could be the problem? I hope there is somebody with experience in this 

Thank you

More information about the Mod_python mailing list