我第一次遇到安装wsgi / trac / python的性能问题。我们有史以来第一次设置trac并遇到一些问题。
据我所知,我已经在正确的位置安装了组件,我的Apache通过Wamp托管,我将使用MySql 5.x作为数据库后端。
当我在Apache配置中禁用WSGI时,Wamp / Apache加载就好了。我可以浏览我的localhost,phpmyadmin等等,没问题。
但是,当启用WSGI时,我的Apache错误日志会显示以下消息,这些消息似乎永远循环,我的localhost从不响应,也不是我的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
谢谢...
答案 0 :(得分:1)
当我们安装Python时,注册表由其安装程序在Windows中设置,因此wsgi应该能够轻松找到Python模块而无需使用ConfigurationDirectives。
HKLM/Software/Python
或HKLM/Software/WOW6432Node/Python
在该注册表中PythonPath&指定InstallPath可以从哪里搜索模块,dll,lib等...
当名为mod_wsgi的apache模块找不到这些目录时,会发生以下错误
ImportError: No module named site
因此,通过在apache配置文件中添加以下行,我们指定了Python的dll / lib目录
<IfModule wsgi_module>
WSGIPythonHome pathtoyourpythondllandorlibs
</IfModule>
可以在以下位置找到mod_wsgi的更多ConfigurationDirectives http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives