服务器的配置:ubutu9.04 Apache 2 python_mod3 pyhton2.5
.conf文件中python虚拟目录设置
XML/HTML代码
- <Directory /var/www>
- AddHandler mod_python .py
- PythonHandler index
- PythonDebug On
- </Directory>
这样配置,浏览.py文件的时候浏览器提示下子,说明apache不能正确解析.py文件
在网络上搜索了一下资料
尝试了一种解决方法,可行
为apache添加一种文件类型
AddType text/html;qs=1.0 .py
在上面的配置加上这一行就可以正确解析了
XML/HTML代码
- <Directory /var/www>
- AddHandler mod_python .py
- PythonHandler index
- PythonDebug On
- AddType text/html;qs=1.0 .py
- </Directory>

