473,883 Members | 1,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.o rg/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\c onf\httpd.conf in
Notepad.

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

#Start of section pasted in by YOURNAMEGOESHER E

LoadModule python_module modules/mod_python.so

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

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

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

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
#End of section pasted in by YOURNAMEGOESHER E

(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=>Restar t.

PROCEDURE COMPLETED

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

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

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

3. Paste the following text into mptest.py:

from mod_python import apache

def handler(req):

req.write("Hell o 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\h tdocs\test" to "C:\Program Files\Apache
Group\Apache2\c gi-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\h tdocs/test/">

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

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

AddHandler python-program .py
PythonHandler mptest
PythonDebug On

</Directory>
######### ACKNOWLEDGEMENT S ########## 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.pytho n
Jul 18 '05 #1
1 2874
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*****@hotmai l.com> wrote in message news:cf******** *************** ***@posting.goo gle.com...
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.o rg/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
2929
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 apache2-2.0.48-6mdk The rpm installed the python module as: /usr/lib/apache2-extramodules/mod_python.so And added a config file for apache:
0
1610
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 (Internal Server Error). Apache errog.log file looks like : PythonHandler mod_python.publisher: Traceback (most recent call last): PythonHandler
1
2799
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 are apache version2. mod_python v3.1.14 python2.4 The problem is,when i m running my python script,after starting apache
9
3769
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 Apache as opposed to a pure Python solution using Medusa, TwistedMatrix, or the like? Thanks, Matt
1
4365
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): req.content_type = 'text/plain' req.write("Under Construction")
5
3127
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 issue ? thanks for any help.
0
8513
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 /htdocs/python i got my test file: from mod_python import apache
3
4947
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 "D:/softwares/Apache2.2/htdocs"> AddHandler mod_python .py PythonHandler mptest PythonDebug On </Directory>
1
2441
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 python still have long running processes (LRP)? Do LRPs have to do with a Python interpreter running all the time? Or is it something else? I also understand that LRPs are the reason that shared hosting is less
0
10734
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10408
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9569
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7967
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7119
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5794
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4607
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3230
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.