473,406 Members | 2,954 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,406 software developers and data experts.

Running mod_python on Apache on Windows2000 *

Hi, I struggled, and got mod_python running on Apache/Win2k. Follow
these instructions verbatim and you shouldn't have any trouble. These
instructions are based on
"http://www.modpython.org/live/current/doc-html/inst-testing.html".
I've added specific information such as Windows filepaths and
filenames so there's no ambiguity on what you should do. I encourage
you to copy and paste to avoid typing errors.
Cheers,

Rolfe

INSTALLING MOD_PYTHON

1. Make a default installations of the latest/best version of Apache.

2. Make a default installation of the latest/best version of
mod_python.

3. Open C:\Program Files\Apache Group\Apache2\conf\httpd.conf in
Notepad.

4. In httpd.conf, just below the line "#LoadModule ssl_module
modules/mod_ssl.so", copy and paste the following section:

#Start of section pasted in by YOURNAMEGOESHERE

LoadModule python_module modules/mod_python.so

<Directory "C:\Program Files\Apache Group\Apache2\htdocs/test/">

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
<Directory "C:\Program Files\Apache Group\Apache2\cgi-bin/">

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
#End of section pasted in by YOURNAMEGOESHERE

(NOTE: Don't mess around with the other configuration settings in
httpd.conf, - leave good enough alone. Don't worry about the
forward/backward slashes either - it doesn't matter.)

5. Save and close httpd.conf and wait a few seconds.

6. Restart Apache by clicking the Apache monitor icon in your systray
and selecting Apache2=>Restart.

PROCEDURE COMPLETED

##### TESTING MOD_PYTHON #######

1. Create a directory called "test" in htdocs so you end up with
"C:\Program Files\Apache Group\Apache2\htdocs\test"

2. Create a text file called mptest.py in "C:\Program Files\Apache
Group\Apache2\htdocs\test"

3. Paste the following text into mptest.py:

from mod_python import apache

def handler(req):

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

4. Save and close mptest.py.
5. In your file browser, copy and paste mptest from "C:\Program
Files\Apache Group\Apache2\htdocs\test" to "C:\Program Files\Apache
Group\Apache2\cgi-bin".

6. Assuming your sitting at the same machine that's running Apache,
enter the URL "http://localhost/test/mptest.py" in your web browser.
The browser displays "Hello World!" and nothing else. This confirms
that Apache can run cgi scripts in the /test/ directory.

7. Repeat step 6 using the URL "http://localhost/cgi-bin/mptest.py"
instead. The browser displays "Hello World!" and nothing else. This
confirms that Apache can run cgi scripts in the /cgi-bin/ directory.

PROCEDURE COMPLETED - mod_python works!

######## NOTES ######### Remove either of the following sections (from
<Directory to </Directory>) in order to disable cgi scripts in a
particular directory. I understand it is very poor security to run cgi
scripts under htdocs, so I'd try getting rid of that one first.

<Directory "C:\Program Files\Apache Group\Apache2\htdocs/test/">

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
<Directory "C:\Program Files\Apache Group\Apache2\cgi-bin/">

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
######### ACKNOWLEDGEMENTS ########## Thank you, Steve Holden, for
your guidance. I'm very much looking forward to your book, Python Web
Programming.

Thank you Peter Maas for your response on comp.lang.python
Jul 18 '05 #1
1 2840
Any success with Apache/2.0.47 (Win32) + Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32 ?
M-a-S
"Rolfe" <ro*****@hotmail.com> wrote in message news:cf**************************@posting.google.c om...
Hi, I struggled, and got mod_python running on Apache/Win2k. Follow
these instructions verbatim and you shouldn't have any trouble. These
instructions are based on
"http://www.modpython.org/live/current/doc-html/inst-testing.html".
I've added specific information such as Windows filepaths and
filenames so there's no ambiguity on what you should do. I encourage
you to copy and paste to avoid typing errors.
Cheers,

Rolfe

<...>

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: digidalmation | last post by:
Hello all. I've been trying to get my linux server to run mod_python. It's a Mandrake 10 linux box, and apache/mod_python are installed from rpms. apache2-mod_python-2.0.48_3.1.3-1mdk...
0
by: Julien Cigar | last post by:
Hello, I'm using mod_python 3.1.3 with Apache 2.0.54 on a Debian box with the publisher handler and the Clearsilver template engine, and from time to time apache returns an 500 error code...
1
by: neha | last post by:
hi, i m trying to integrate python with apache on linux.For this i m using mod_python. I dont see any problem with the versions of python,apache and mod_python i m using. the versions i m using...
9
by: Matt Helm | last post by:
I am starting the design phase of a large project (ERP) where the backend will mostly be Python (or Ruby) providing web services. In this type of usage, is there any benenfit to running under...
1
by: treelife | last post by:
I'm getting and internal server error when | run the following mod_python script. I am actually trying to run Django. Script: from mod_python import apache def handler(req):...
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...
0
by: Mathias K. | last post by:
Hello everyone! I just installed Python 2.5 and i want to use Python to build websites. I could load mod_python successfully with Apache but i fail to let the .py-files to be executed! In...
3
by: joe jacob | last post by:
I configured apache to execute python scripts using mod_python handler. I followed below mentioned steps to configure apache. 1. In http.conf I added <Directory...
1
by: walterbyrd | last post by:
I understand that Python has them, but PHP doesn't. I think that is because mod_php is built into apache, but mod_python is not usually in apache. If mod_python was built into apache, would...
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: 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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.