The installation procedure on Windows is like this:
- Install Apache server from httpd-2.2.17-win32-x86-openssl-0.9.8o.msi
- Install python 2.5 from python-2.5.2.msi
- Install mod_python-3.3.1.win32-py2.5-Apache2.2.exe showing it apache main directory (in my case it was: c:\Program Files\Apache Software Foundation\Apache2.2\modules\)
- If step 3 won’t work for you, do this step as well. Copy mod_python.dll and mod_python.so to: $apache$/modules/
(in my case it was: c:\Program Files\Apache Software Foundation\Apache2.2\modules\) - Copy all the files from mod_python-3.3.1.tar\mod_python-3.3.1\lib\python\mod_python\*.* to c:\Python25\Lib\mod_python\
(there are 12 *.py files in there) - Change httpd.conf
add this line in # Dynamic Shared Object (DSO) Support section:
LoadModule python_module modules/mod_python.so
add this piece of code in two sections (#ScriptAlias: and in IfModule cgid_module section:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/python">
AddHandler mod_python .py
PythonHandler test
PythonDebug on
</Directory>
example httpd.conf can be found in my package.
7. Create a file for testing: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/python/test.py
test name is important as we defined the name earlier in “PythonHandler” section!!!!
package with all the files needed:
http://sites.google.com/site/bkosarzyckiaboutme/ApachePythonPackage.rar
No comments:
Post a Comment
If you like this post, please leave a comment :)