Python安装笔记的实际应用的九种步骤介绍(1)
Python安装笔记的实际应用的九种步骤介绍(1)
如果你在Python安装笔记的实际应用方面有一些不清楚的地方,或是你是在Python安装笔记这方面的新手,你可以浏览我们的文章,希望会对你有所收获,以下是文章相关内容的详细介绍。
以下步骤是自己配置过程一些记录。希望能对想使用mod_python的人有点帮助。另外请注意测试代码的缩进。
1.下载个新版 注意版本问题apache和python版本)
2.拷到linux机器上,下面在命令行执行Python安装笔记:
- tar -zxvf mod_python-3.3.1.tgz
- cd mod_python-3.3.1
- ./configure --with-apxs=/usr/local/apache/bin/apxs
配置apxs目录
- ./configure --with-python=/usr/bin/python2.5
配置本地python
- make
- make install
3.这些编译完了,会在apache/modules/目录下生成mod_python.so,大概3M左右。
4.配置apache的http.conf
- LoadModule python_module modules/mod_python.so
- <Directory "/usr/modpython">
能用apache访问的目录
- #AddHandler mod_python .py
- SetHandler mod_python
- PythonHandler mod_python.publisher
- PythonDebug On
- </Directory>
5.测试在/usr/modpython/目录下新建一个test.py
- #coding:gb2312
- def index(req):
- req.write("hello,world!")
- return
6.运行Python安装笔记,启动apache没有错误后,
热门文章:
相关内容
- 暂无相关文章
评论关闭