mod_python

Jim Gallacher jg.lists at sympatico.ca
Tue Oct 11 12:53:43 EDT 2005


Python_it wrote:
> Today I was busy to install mod_python.
> 
> I have put the line
> 
> LoadModule python_module libexec/mod_python.so
> 
> into the httpd.conf file.
> It Works!
> Apache load mod_python /3.2.2.b Python2.4
> 
> But my problem is where I have to place te following code in de
> httpd.conf?
> 
>     <Directory C:\Program Files\Apache Group\Apache2\htdocs\project\>
>         AddHandler mod_python .py
>         PythonHandler mptest
>         PythonDebug On
>     </Directory>
> 
> Because al the tutorials write this. But where?
> 
> If I try to put the code some where,
> apache give the following message by testing the configure:
> Multiple <Directory> arguments not (yet) supported
> But what i have to change or replace.

Your problem is not related to the location of the <Directory> section. 
Apache doesn't like spaces in <Directory>, so try quoting your path. 
Also, the Apache docs state that "forward slashes should always be used 
as the path separator in Apache, even for Windows".

So try the following in your config file:
   <Directory "C:/Program Files/Apache Group/Apache2/htdocs/project/">.

> I test with the next file:
> 
> C:\Program Files\Apache Group\Apache2\htdocs\project\
> mptest.py
> 
> from mod_python import apache
> 
> def handler(req):
>    req.content_type = 'text/plain'
>    req.send_http_header()
>    req.write('mptest.py\n')
>    return apache.OK
> 
> Is this code enough for testing?
> 

Yes.

You are more likely to get timely help on the mod_python mailing list. 
See http://www.modpython.org/ for subscription information. Personally I 
only read c.l.p when I'm looking for cheap entertainment. Some people on 
this list just crack me up. :)

Regards,
Jim



More information about the Python-list mailing list