【发布时间】:2010-12-12 13:36:17
【问题描述】:
我今天一整天都在尝试让 MOD_WSGI 在我的 Mac OS X Snow Leopard 上通过 XAMPP 在 Apache 上工作,但没有任何成功。我已按照所有说明进行操作,在互联网上搜索解决方案等,但到目前为止还没有运气。以下是我的确切步骤和详细信息。当我运行 localhost 时,我得到的只是一个白屏。当我从 httpd.conf 中删除“LoadModule wsgi_module modules/mod_wsgi.so”时,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
【问题讨论】:
-
你检查过 apache 日志文件吗?他们说什么?
-
我正在尝试同样的事情,但在第 5 步时出现错误。:
cannot open /Applications/xampp/xamppfiles/build/config_vars.mk: No such file or directory at /Applications/XAMPP/xamppfiles/bin/apxs line 218.知道如何纠正这个问题吗? -
没关系。我正在使用默认的xampp。我需要使用 xampp 的开发包。 :)
标签: python apache macos xampp mod-wsgi