/*!
python 2.6.x 构建 mod_python 及 apache 下的简单配置
created by : andrew.wu (erpingwu@gmail.com)
created on : 2009/05/26
url : http://blog.oolanguage.com/erpingwu/python-26x-构建-mod_python-及-apache-下的简单配置/
*/
构建及安装
下载 https://svn.apache.org/repos/asf/quetzalcoatl/mod_python/trunk/
修改 mod_python/dist/setup.py.in line 171 不生成 psp module
ext_modules = [ModPyModule]#, PSPModule]
如果需要psp, 注释掉 line 112 , 113
#extra_link_args=ARCHFLAGS,
#extra_compile_args=ARCHFLAGS,
mod_python/dist/build_installer.bat line 22 加
SET APACHESRC=c:/libs/xampp-win32-devel-1.7.0/apache/
Run build_installer.bat
mod_python/dist/dist/mod_python-3.3.2-dev-20080819.win32-py2.6.exe 安装
配置
D:/xampp170/apache/conf/httpd.conf
LoadModule python_module modules/mod_python.so
D:/xampp170/apache/conf/extra/httpd-vhosts.conf
1/方案一
AddHandler mod_python .py
PythonHandler index
2/方案二
AddHandler mod_python .py .psp
PythonHandler mod_python.publisher
PythonHandler mod_python.psp | .psp
PythonDebug On
D:/xampp170/htdocs/pyt/index.py
from mod_python import apache def handler(req): req.write("Hello mod_python!") return apache.OK
参考:
http://badwords.org/w/Compile_mod_python_for_Python_2.6.1 Compile mod python for Python 2.6.1
http://www.modpython.org/