python 2.6.x 构建 mod_python 及 apache 下的简单配置

 /*!
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/

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值