472,348 Members | 1,244 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

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 1895
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Bear | last post by:
I will be running zope, and I would also like to run mod_python. The problem arised when zope wants a threaded version of python and mod_python...
0
by: Python_it | last post by:
I'm going to work with mod_python. I install mod_python 3.2.2b for python 2.4. If i test my install with mptest.py see this link:...
6
by: Anthony L. | last post by:
I am writing a web application that is comparable to a content management system used in blogging. I really want to use Python after having done...
3
by: Charles | last post by:
Hello, I'm think about using mod_python for a project but I need to make sure: Does mod_python time out after a minute ? (I hope not). If I leave...
5
by: m.banaouas | last post by:
Hi, bonjour, witch versions are suitable to use for apache & mod_python ? Can i install and use "Apache 2.2.3" & "mod_python 3.2.10" (most...
2
by: m.banaouas | last post by:
I installed Apache 2.2.3 and mod_python 3.2.10 on WinXP plateform I configured mod_python via httpd.conf: LoadModule python_module...
3
by: Michael | last post by:
Hey everyone, Is it possible to automatically insert headers/footers using mod_python? I will be not be using PSP's, so I cannot use the...
3
by: Lawrence D'Oliveiro | last post by:
In message <mailman.109.1216158151.922.python-list@python.org>, Cyril Bazin wrote: What's the error message? This should be in Apache's...
0
by: Simo D | last post by:
Hi, I'm using a script.py to write a file in a dir on the server. Mod_python work but i get: Mod_python error: "PythonHandler mod_python.publisher"...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.