469,645 Members | 1,941 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Getting mod_python to Work

Hi, all...

I am hoping that someone can help me with the magic incantation to get
mod_python working on my local machine.

Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity
me).

I've gotten the basic mptest.py handler to work with no problem. I am
now trying to use the mod_python.publisher, but when I do, I get a 404
Not Found error for any file I try to access. If I switch back to my
simple mptest,py handler, everything works fine.

What do I need to do so that I can use the mod_python.publisher?

Here is the relevant section from my httpd.conf file:

LoadModule python_module modules/mod_python.so
<Directory "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-
bin/">
AddHandler mod_python .py
#PythonHandler mptest --- works if I uncomment this line and comment
next line
PythonHandler mod_python.publisher
PythonDebug On
</Directory>

Many thanks,
jpuopolo

Aug 5 '08 #1
1 1822
On Aug 5, 8:44*am, jpuopolo <puop...@gmail.comwrote:
Hi, all...

I am hoping that someone can help me with the magic incantation to get
mod_python working on my local machine.

Set up: Apache 2.2.9, mod_python 3.3.1 on Windows Vista (yes, pity
me).

I've gotten the basic mptest.py handler to work with no problem. I am
now trying to use the mod_python.publisher, but when I do, I get a 404
Not Found error for any file I try to access. If I switch back to my
simple mptest,py handler, everything works fine.

What do I need to do so that I can use the mod_python.publisher?

Here is the relevant section from my httpd.conf file:

LoadModule python_module modules/mod_python.so
<Directory "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-
bin/">
* AddHandler mod_python .py
* #PythonHandler mptest --- works if I uncomment this line and comment
next line
* PythonHandler mod_python.publisher
* PythonDebug On
</Directory>

Many thanks,jpuopolo
All:

As it turns out, it was the URL I was using that made the difference -
and the URL that worked was http://localhost/cgi-bin/helloworld.py/handler

Note the /handler at the end of the URL --- this made all the
difference.

I found the answer here: http://mohitsuley.wordpress.com/2008...od_python-101/

So, in summary, to have mod_python work:

1. Add the following to your httpd.conf file:

#Start of section pasted in by YOURNAME
LoadModule python_module modules/mod_python.so
<Directory "C:\Program Files\Apache Software Foundation\Apache2.2\cgi-
bin/">
AddHandler mod_python .py
PythonHandler mod_python.publisher
PythonDebug On
</Directory>
#End of section pasted in by YOURNAME

I put this at the end of the other LoadModule entries in the
httpd.conf file.

2. Save your httpd.conf file.
3. Restart Apache (either close/restart or restart the Windows
service, depending on your configuration).
4. Ensure the URL to your .py files in your cgi-bin directory (or
whatever directory you've configured, see above) end in /handler

I hope this helps someone...

Thank you,
jpuopolo
Aug 5 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by David Bear | last post: by
reply views Thread by Python_it | last post: by
6 posts views Thread by Anthony L. | last post: by
3 posts views Thread by Charles | last post: by
5 posts views Thread by m.banaouas | last post: by
2 posts views Thread by m.banaouas | last post: by
3 posts views Thread by Michael | last post: by
3 posts views Thread by Lawrence D'Oliveiro | last post: by
reply views Thread by Simo D | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.