By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,101 Members | 1,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,101 IT Pros & Developers. It's quick & easy.

Successful installation of mod_python on Apache on Win2k?

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
> 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.