[mod_python] Apache not executing python scripts...

Wojtek Dabrowski falka777 at gmx.de
Tue Jun 21 11:34:44 EDT 2005

Hello everybody!

I just installed apache 2 and mod_python (apt-get install apache2
libapache2-mod-python, on debian). apache 2 works fine, but I can't get
mod_python to work, I keep getting the suggestion to download my .py file :(

When I restart apache, I get the following in error.log:

[Tue Jun 21 17:17:48 2005] [notice] caught SIGTERM, shutting down
[Tue Jun 21 17:17:49 2005] [notice] mod_python: Creating 32 session
mutexes based on 6 max processes and 25 max threads.
[Tue Jun 21 17:17:49 2005] [notice] Apache/2.0.54 (Debian GNU/Linux)
mod_python/3.1.3 Python/2.3.5 configured -- resuming normal operations

which, to me, indicates that mod_python is getting loaded correctly.

I have the following in my httpd.conf:

<Directory /var/www/Dwojtek/>
    AddHandler mod_python .py
    PythonHandler mptest
    PythonDebug On

I also have a .htaccess in /var/www/Dwojtek/, containing the lines:

AddHandler mod_python .py
PythonHandler mptest
PythonDebug On

But when I go to, I get a download
box. I don't wanna download the script, I want it executed :(

The corresponding line in the access.log is: - - [21/Jun/2005:17:31:01 +0200] "GET /Dwojtek/mptest.py
HTTP/1.1" 200 12 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8)
Gecko/20050511 Firefox/1.0.4"

Which seems correct, too...

The mptest.py is, by the way:

from mod_python import apache

def handler(req):
    req.write("Hello World!")
    return apache.OK

Oh, and when I go to, I just get a directory

Anybody any ideas what I may be doing wrong? :(

Thanks a lot in advance,

This is a .signature-virus. If you see this, copy it into your .signature!
If you don't know what a .signature is, you've most probably been
infected by another virus of name Microsoft. In this case, please remove
yourself from my fov or infect yourself with linux ;)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20050621/00b8c683/signature.bin

More information about the Mod_python mailing list