james daily
jdaily at kc.rr.com
Sun Jul 14 20:01:21 EST 2002
the mod_python online manual at: http://www.modpython.org/live/mod_python-2.7.8/doc-html/app-wininst.html says: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX A. Windows Installation Notes originally created by Enrique Vaamonde evaamo at loquesea.com Your mileage may vary with these instructions You need to have the following packages properly installed and configured in your system: Python 1.5.2 or 2.0 Apache 1.3 Winzip 6.x or later. You need to download both the mod_python.dll and the mod_python-x.tgz (where x is the version number) files from the main page. Once you have all the things above mentioned we're good to go. Installing mod_python libraries Use Winzip to extract the distribution file (mod_python-x.tgz) into a temporary folder (i.e C:\temp): NOTE: If Winzip shows this warning "Archive contains one file, should Winzip decompress it to a temporary folder?" just click on Yes, the content of the file should appear in Winzip right after. Select all the files in Winzip and click on the Extract button, then type-in the path or just browse your way to the temporary folder and click extract. Open your Windows Explorer and locate the temporary folder where you extracted the distribution file, you should have a new folder in your temporary folder (C:\temp\mod_python-x). Move (or just drag & drop) the mod_python-x folder into the Python lib folder (i.e C:\Program Files\Python\lib). Move the files in the folder lib inside the mod_python folder (C:\Program Files\Python\lib\mod_python-x\lib\mod_python) to the C:\Program Files\Python\lib\mod_python folder. It's safe to delete these folders we just emptied. xxxxxxxxxxx also put the files from "mod_python-2.7.8\src\include\" into "D:\Program Files\python211\Python21\include" which allowed apache to start. xxxxxxxxxxx Integrating it with Apache Once the distribution file is correctly extracted and later moved into the Python directory, it's time to modify your Apache configuration (httpd.conf) and integrate the server with mod_python. These are a few steps we must do first: Locate the file mod_python.dll that you downloaded before and move it to Apache's modules folder (i.e C:\Program Files\Apache Group\Apache\modules). Go to the Apache configuration folder (i.e C:\Program Files\Apache Group\Apache\conf\) and edit the httpd.conf file. Add the following line in the section "Dynamic Shared Object (DSO) Support" of the httpd.conf file: LoadModule python_module modules/mod_python.dll Add the following lines in the section ScriptAlias and CGI of the httpd.conf: <Directory "<Your Document Root>/python"> AddHandler python-program .py PythonHandler mptest PythonDebug on </Directory> NOTE: Replace the <Your Document Root> above with the Document Root you specified on the DocumentRoot directive in the Apache's httpd.conf file. Last, create a folder under your Document Root called python. Testing Create a text file in the folder we created above and call it mptest.py (you can use Notepad for this). Insert the following lines and save the file (Make sure it gets saved with the .py extension): from mod_python import apache def handler(req): req.content_type = "text/plain" req.send_http_header() req.write("Hello World!") return apache.OK Make sure Apache is running (or launch it!) and then point your browser to the URL referring to the mptest.py, you should see "Hello World!". That's it, you're ready to roll!! If you don't see the "Hello World!" message, the next section is for you. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Apache/1.3.14 (Win32) running... Python 2.1.1 all i get in the browser is the text of mptest.py any suggestions? if someone has it actually running on their windows 98 system, could you please send me the ***relevant*** portions from your apache httpd.conf file? i have tried numerous different approaches to no avail. alas, i am a programmer but not (yet) an apache guru. any help would be greatly appreciated. --------------------------------------------- James Daily Phone : 816 943 9891 Email : wndrer at earthling.net (or hit reply button) Web : http://tellmama.com/ Philosophy: 4 2 1000 ( cos(ø - r) - sin ø ) * ( r - 2r cos(2ø + 2.4) + 0.9) + 0.62r) < 0 Education is a progressive discovery of our own ignorance. Will Durant
|