Successful installation of mod_python on Apache on Win2k?

R

Rolfe

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/current/doc-html/inst-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
 
P

Peter Maas

Rolfe said:
3. When I created and ran the following script shown at
http://www.modpython.org/live/current/doc-html/inst-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
 
R

Rolfe

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 said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top