在Windows 64位上将mod_wsgi模块加载到apache的问题

我试图按照这个指令安装mod_wsgi模块。 我已经从这个源下载了mod_wsgi.so。 看起来像apache无法正确地重新启动服务,并且在将以下行添加到httpd.conf后无法加载该页面

LoadModule wsgi_module modules/mod_wsgi.so

我已经从一些来源检查了一些问题,如下所示:

  1. 文件名是正确的 – mod_wsgi.so不是mod_wsgi.so.so
  2. 该文件的权限设置为与正确加载的其他模块相同
  3. Python为所有用户安装

环境:

  • WindowsServer®Standard FE 64位
  • WAMP 2.0上的Apache 2.2.8
  • Python 2.7.1为所有用户安装

不加载这个模块,Apache运行正常。 我的问题是什么?

应用程序error.log:

 [Mon May 23 10:12:20 2011] [notice] Parent: Received shutdown signal -- Shutting down the server. [Mon May 23 10:12:20 2011] [notice] Child 4528: Exit event signaled. Child process is ending. [Mon May 23 10:12:21 2011] [notice] Child 4528: Released the start mutex [Mon May 23 10:12:22 2011] [notice] Child 4528: All worker threads have exited. [Mon May 23 10:12:27 2011] [notice] Child 4528: Child process is exiting [Mon May 23 10:12:28 2011] [notice] Parent: Child process exited successfully. [Mon May 23 10:13:46 2011] [notice] Apache/2.2.8 (Win32) PHP/5.2.6 configured -- resuming normal operations [Mon May 23 10:13:46 2011] [notice] Server built: Jan 18 2008 00:37:19 [Mon May 23 10:13:46 2011] [notice] Parent: Created child process 5316 [Mon May 23 10:13:46 2011] [notice] Child 5316: Child process is running [Mon May 23 10:13:46 2011] [notice] Child 5316: Acquired the start mutex. [Mon May 23 10:13:46 2011] [notice] Child 5316: Starting 64 worker threads. [Mon May 23 10:13:46 2011] [notice] Child 5316: Starting thread to listen on port 81. [Mon May 23 10:14:57 2011] [notice] Parent: Received shutdown signal -- Shutting down the server. [Mon May 23 10:14:57 2011] [notice] Child 5316: Exit event signaled. Child process is ending. [Mon May 23 10:14:58 2011] [notice] Child 5316: Released the start mutex [Mon May 23 10:14:59 2011] [notice] Child 5316: All worker threads have exited. [Mon May 23 10:15:04 2011] [notice] Child 5316: Child process is exiting [Mon May 23 10:15:04 2011] [notice] Parent: Child process exited successfully. 

从apache error.log,是否清楚,安装的Apache是​​32位?

解决scheme:将所有内容更改为64位。

我也遇到了这种情况,Apache将在Windows 64位上运行,但是如果加载了mod_wsgi,则不会。

我找到了一个非常简单的解决方案:

  1. 下载并安装64位版本的Apache,如果您从http://wampserver.com/下载并安装,可轻松处理
  2. 从这个页面下载mod_wsgi
  3. 将下载的压缩文件的内容解压缩到c:\wamp\bin\apache\Apache2.2.21\modules\
  4. 编辑httpd.conf并添加一行: Loadmodulee wsgi_module modules/mod_wsgi.so
  5. 重新启动apache,然后你可以继续你的django开发。

总结:所有(apache和mod_wsgi)都必须是64位才能在64位窗口上运行Apache / mod_wsgi。

从我的理解…

目前还没有针对Microsoft Windows的官方64位版本的Apache和PHP版本。

然而,在那里有一个人,在写这篇文章的时候,至少为我们编译了Apache 2.2.19 x64 ,你可以在这里下载。

如果你想要一个更新的版本,你必须自己编译它,但这将是相当的事业!

而且,即使你确实在Windows上运行Apache x64,你打算如何处理mod_wsgi呢? 这就是我决定为这个目的创建一个Arch Linux LAMP栈的原因。 我现在工作得很好,但是由于Aptana没有与Django项目同步,所以我正在重新研究Windows解决方案。

请让我知道,如果你找到一个很好的解决方案!

编辑:我发现这些64位mod_wsgi的py2.6和2.7 ,但我还没有得到他们的工作。

编辑:是的! 我得到它的工作! 我的Apache服务监视器有一个绿灯,现在说Apache / 2.2.19(Win64)mod_wsgi / 3.3 Python / 2.6.4。 我正在使用2.6.4版本,因为这是Autodesk Maya正在运行的版本,我希望保持相同版本的一致性。

我在Windows 2008服务器上运行Apache / Mod_wsgi。

由Peter提供的64位版本的Apache的链接被破坏了。 我发现一个为我工作的:

http://www.apachelounge.com/download/win64/

阅读readme.txt。 安装非常简单。

他的64位mod_wsgi的链接还是不错的:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi

我使用了win-amd64版本,我觉得我使用的硬件是Intel。

我确保Apache和Mod_wsgi版本与python版本相匹配。 我相信我使用的mod_wsgi版本是3.3。