我今天整天都在尝试让 MOD_WSGI 在我的 Mac OS X Snow Leopard 上通过 XAMPP 在 Apache 上工作,但没有任何成功。我已按照所有说明进行操作,在互联网上搜索解决方案等,但到目前为止还没有运气。以下是我的确切步骤和详细信息。当我运行 localhost 时,我得到的只是一个白屏。wsgi_module modules/mod_wsgi.so
当我从 httpd.conf中删除“LoadModule ”时,localhost 会按预期运行。
- 下载并安装 Xcode。
- XAMPP 已经安装并正在运行。
- 我不需要安装 Python,因为 OS X 已经有 64 位模式的 Python 2.6。
- 下载并解压 mod_wsgi-2.6.tar.gz 到桌面。
- 终端“./configure --with-apxs=/Applications/XAMPP/xamppfiles/bin/apxs --with-python=/System/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6”(否错误)
- 终端“make”(消息“make:Nothing to be done for `all'.”)
- 终端“sudo make install”(没有错误)
- 添加到 XAMPP 的 httpd.conf 文件:
LoadModule
wsgi_module modules/mod_wsgi.so
AddType text/html .py
WSGIScriptAlias /app-sample "/Applications/xampp/xamppfiles/htdocs/app-sample/main.py"
<Directory "/Applications/xampp/xamppfiles/htdocs/app-sample">
Order deny,allow
Allow from all
</Directory>
- 通过 XAMPP 重启 Apache