471,579 Members | 1,283 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Successful installation of mod_python on Apache on Win2k?

Has anyone had success getting mod_python to run on Apache on Win2K?
I'm writing up instructions on how to do this and need your help. When
completed, the instructions at the mod_python website and on
comp.lang.python crediting all those who contributed.
<p>
Here's what I've done so far - and where I get stuck:
<p>
1. I made default installations of the latest versions:
- apache_2.0.47-win32-x86-no_ssl.msi
- mod_python-3.0.3.win32.exe
<p>
2. I followed the installation/configuration instructions provided at
the end of the mod_python-3.0.3.win32.exe installation.
<p>
3. When I created and ran the following script shown at
http://www.modpython.org/live/curren...t-testing.html, my
browser displays the full text of the script instead of running the
script:
"from mod_python import apache

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

4. I've read Troubleshooting and FAQ, triple-checked my http.conf
file, and still can't get it to work.

ANY SUGGESTIONS?

Thanks,

Rolfe
Jul 18 '05 #1
2 1860
Rolfe wrote:
3. When I created and ran the following script shown at
http://www.modpython.org/live/curren...t-testing.html, my
browser displays the full text of the script instead of running the
script:
"from mod_python import apache

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

4. I've read Troubleshooting and FAQ, triple-checked my http.conf
file, and still can't get it to work.

ANY SUGGESTIONS?


This is my working conf (on Linux, though):

LoadModule python_module modules/mod_python.so

<Directory /usr/local/apache2/htdocs/test>
AddHandler python-program .py
PythonHandler mptest
PythonDebug On
</Directory>

/usr/local/apache2/htdocs/test/mptest.py works. If you have an
analogous conf, it might be an OS related issue.

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 pe********@mplusr.de
-------------------------------------------------------------------

Jul 18 '05 #2
> From: Rolfe Dlugy-Hegwer [mailto:RDlugyHegwer at symmetricom dot com]
Sent: Thursday, September 25, 2003 7:53 PM
To: 'sholden at holdenweb dot com'
Subject: mod_python on Win2k question
Hi Steve,

I saw your thread on comp.lang.python: "I'm interested in installing
mod_python in two environments:1. Wind2000/Apache2"

Any joy getting mod_python to run on Win2k?
Oh, yes. To quote Stanley Unwin (of whom you've probably never heard)
"Deep joy in the fundimole".
I 1)downloaded fresh versions of apache and mod python, 2)made default
installations, 3)followed additional configuration
instructions for mod
python, 4) followed the tests recommended by mod_python
documentation, 5)
OK, well I [...] just downloaded the installer. I
had Python 2.2 installed, and I decided not to push the envelope by
recompiling for 2.3 (which I also had installed). I also chose the
somewhat older 3.0 mod_python, and then bolted the session and cookie
stuff on from the 3.1 alpha mod_python, which seems to work after a bit
of grotesque hacking an d one bug removal.
consulted the mod_python FAQ
and I can't get it to work. My browser displays the .py file
as text instead
of running it as a script.
It's probably the directory characteristics that need to change. If you
plan to use the publisher interface (probably about the most general
thing to do), you need to bear two things in mind:

1. Mod_python doesn't play well in script-aliased directories, so don't
try using your cgi-bin directory for mod_python scripts.

2. You'll need an .htaccess file that reads something like [ferkles in
/Inetpub/wwwroot/modpython ...] this:

DirectoryIndex index.py
AddHandler python-program .py
PythonHandler mod_python.publisher
PythonDebug On

Actually you don't need the DirectoryIndex line, and obviously you can
set up equivalent <Directory> lines in httpd.conf instread if you want.
I'm going find someone who has succeeded and will write up
instructions for
the mod_python FAQ and for comp.lang.python.

I'm sure that would be very useful. Let me know if this has helped! [...] ;-)

regards
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
Interview with GvR August 14, 2003 http://www.onlamp.com/python/
Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Patrick Useldinger | last post: by
reply views Thread by Andrea Fiore | last post: by
reply views Thread by Julien Cigar | last post: by
2 posts views Thread by Robert J. Hansen | last post: by
1 post views Thread by treelife | last post: by
4 posts views Thread by Gaurav Agarwal | last post: by
5 posts views Thread by m.banaouas | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
1 post views Thread by lumer26 | last post: by

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.