【发布时间】:2011-08-08 17:00:24
【问题描述】:
我第一次安装 wsgi/trac/python 时遇到性能问题。我们是第一次设置 trac,但遇到了一些问题。
据我所知,我已经在正确的位置设置了组件,我的 Apache 通过 Wamp 托管,我将使用 MySql 5.x 作为数据库后端。
当我在我的 Apache 配置中禁用 WSGI 时,Wamp/Apache 可以正常加载。我可以浏览到我的 localhost、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
谢谢...
【问题讨论】:
-
在通往运行 trac 系统的道路上还有其他机会,但是,我相信我已经解决了这个问题。似乎 Apache httpd.conf 文件需要这样的块:
WSGIPythonHome pathtoyourpythondllandorlibs 。这似乎解决了眼前的问题;不要再折腾了。 -
如果您自己解决了问题,我认为您应该将其写为答案,而不是评论,并将其标记为已接受。
-
mod_wsgi 模块不需要设置 WSGIPythonHome。该选项存在,但在 Windows 上,您需要它的情况极为罕见,并且认为我只听说过它所在的一个实例。您的问题没有明确说明循环消息是在 Apache 启动时立即出现,还是在首次请求 Trac 时发生。如果您的系统上安装了多个 Python,您还需要概述。