473,379 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 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 1950
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 wants no_threads. I've been searching the...
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 some evaluation coding using Python 2.3.5 with...
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 an HTTP connection open so that the content keeps...
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 recent versions) without facing any known major...
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 modules/mod_python.so but my script folder configuration...
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 PSP/include solution. Furthermore, the header will be...
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 error_log file.
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" Traceback (most recent call last): File...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.