我用Homebrew来构build和安装mod_wsgi:
$ brew install mod_wsgi ==> Downloading http://modwsgi.googlecode.com/files/mod_wsgi-3.2.tar.gz ######################################################################## 100.0% ==> ./configure --prefix=/usr/local/Cellar/mod_wsgi/3.2 --disable-debug --disabl ==> make install ==> Caveats NOTE: "brew install -v mod_wsgi" will fail! You must install in non-verbose mode for this to succeed. Patches to fix this are welcome (and should be sent upstream too.) * You must manually edit /etc/apache2/httpd.conf to load /usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so * On 10.5, you must run Apache in 32-bit mode: http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX ==> Summary /usr/local/Cellar/mod_wsgi/3.2: 3 files, 344K, built in 18 seconds $
然后,我将下面一行添加到/etc/apache2/httpd.conf中:
LoadModule mod_wsgi_module /usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so
然后我重启Apache(用sudo apachectl restart )。 但是当我加载http:// localhost /时 ,我得到了“无法连接到服务器”,我在/ private / var / log / apache2 / error_log中看到以下内容:
[Tue Jul 06 15:15:18 2010] [notice] caught SIGTERM, shutting down
如果我注释掉LoadModule行并重新启动Apache,它将继续工作。
如何按照brew安装说明的指示正确地“手动编辑/etc/apache2/httpd.conf来加载/usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so”?
(我正在运行Mac OS X 10.6.4。)
更新 :我按照说明在http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX上强制执行32位,但仍然有同样的问题。
跑:
sudo apachectl -t
您将清楚地看到您在configuration中发生了错误。 使用:
LoadModule wsgi_module /usr/local/Cellar/mod_wsgi/3.2/libexec/mod_wsgi.so
因为说明应该告诉你。 也就是说,使用'wsgi_module'而不是'mod_wsgi_module'。 看到:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Loading_Module_Into_Apache
如果HomeBrew是告诉你,否则他们的指示是错误的。