mod_python problem

Peter Maas peter.maas at mplusr.de
Fri May 7 04:40:45 EDT 2004


Gandalf wrote:
> Apache/2.0.48 (Unix) PHP/4.3.4 mod_python/3.0.3 Python/2.3.3 
> mod_ssl/2.0.48 OpenSSL/0.9.7c Server at arwen.msnet Port 80
> 
> This is what I have in httpd.conf:
> 
> LoadModule python_module libexec/apache2/mod_python.so
> AddHandler mod_python .py
> AddType applcation/x-http-python .py
> 
> <Directory />
>  PythonHandler mod_python.publisher
>  PythonDebug On
> </Directory>

I think your handler and your script don't match.
This is my working conf:

LoadModule python_module      modules/mod_python.so
...
# This directive shouldn't be important (only for psp)
<Directory "/usr/local/apache2/htdocs">
     Options Indexes FollowSymLinks MultiViews +ExecCGI
     AddHandler cgi-script cgi py
     AddHandler mod_python .psp
     PythonHandler mod_python.psp
     PythonDebug On
</Directory>

# This directive enables Python scripts in a subdirectory
<Directory /usr/local/apache2/htdocs/test>
   AddHandler python-program .py
   PythonHandler mptest
   PythonDebug On
</Directory>

mptest.py:

from mod_python import apache

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

Mit freundlichen Gruessen,

Peter Maas

-- 
-------------------------------------------------------------------
Peter Maas, M+R Infosysteme, D-52070 Aachen, Hubert-Wienen-Str. 24
Tel +49-241-93878-0 Fax +49-241-93878-20 eMail peter.maas at mplusr.de
-------------------------------------------------------------------



More information about the Python-list mailing list