安装 Trac / WSGI / Python 的 Apache 错误
我在第一次安装 wsgi/trac/python 的时候遇到了性能问题。我们正在第一次设置 trac,但遇到了一些麻烦。
据我所知,我已经把相关组件放在正确的位置,我的 Apache 是通过 Wamp 托管的,数据库后端将使用 MySql 5.x。
当我在 Apache 配置中禁用 WSGI 时,Wamp/Apache 一切正常。我可以顺利访问我的本地服务器、phpmyadmin 等,没有任何问题。
但是,当我启用 WSGI 后,我的 Apache 错误日志显示了一些信息,这些信息似乎一直在循环,我的本地服务器和 phpmyadmin 都没有响应。
我怀疑可能是某种配置循环的问题,但我不知道具体在哪里,需要一些指导来看看该注意什么。
在我们的 Apache 配置中,还有什么我遗漏的地方吗?
ImportError: No module named site
[Mon Aug 08 10:49:51 2011] [notice] Parent: child process exited with status 1 -- Restarting.
[Mon Aug 08 10:49:51 2011] [warn] mod_wsgi: Compiled for Python/2.7.
[Mon Aug 08 10:49:51 2011] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Mon Aug 08 10:49:51 2011] [notice] Apache/2.2.17 (Win32) mod_wsgi/3.3 Python/2.7.2 PHP/5.3.5 configured -- resuming normal operations
[Mon Aug 08 10:49:51 2011] [notice] Server built: Oct 18 2010 01:58:12
[Mon Aug 08 10:49:51 2011] [notice] Parent: Created child process 3116
[Mon Aug 08 10:49:51 2011] [warn] mod_wsgi: Compiled for Python/2.7.
[Mon Aug 08 10:49:51 2011] [warn] mod_wsgi: Runtime using Python/2.7.2.
[Mon Aug 08 10:49:51 2011] [notice] Child 3116: Child process is running
谢谢...
1 个回答
1
当我们在Windows上安装Python时,安装程序会在注册表中设置一些信息,这样wsgi就能轻松找到Python模块,而不需要使用配置指令。
HKLM/Software/Python
或者 HKLM/Software/WOW6432Node/Python
在这个注册表中,PythonPath和InstallPath被指定了,这样Python就知道从哪里去寻找模块、dll文件、库等等。
如果Apache的mod_wsgi模块找不到这些目录,就会出现以下错误:
ImportError: No module named site
所以,通过在Apache的配置文件中添加以下一行,我们就指定了Python的dll和lib所在的目录。
<IfModule wsgi_module>
WSGIPythonHome pathtoyourpythondllandorlibs
</IfModule>
关于mod_wsgi的更多配置指令,可以在这里找到: http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives