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

2024-04-29 19:14:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装mod_wsgi模块,请遵循以下步骤instruction。我从this source下载了mod_wsgi.so。在我向httpd.conf添加了以下行之后,apache似乎无法正确地重新启动服务,并且无法加载页面

LoadModule wsgi_module modules/mod_wsgi.so

我已经从以下来源检查了一些问题:

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

环境:

  • Windows Server®标准FE 64位
  • WAMP 2.0上的apache2.2.8
  • 为所有用户安装的Python2.7.1

不加载这个模块,apache就可以正常运行。我有什么问题?

应用程序错误.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位的吗?

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


Tags: 模块themodchildwsgisoisapache
3条回答

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

彼得提供的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。

我也遇到过这种情况,Apache将在windows64位上运行,但是如果mod_wsgi被加载,它就不会运行。

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

  1. 下载并安装64位版本的Apache 从http://wampserver.com/下载并安装时处理
  2. this page下载mod_wsgi
  3. 将下载的压缩文件的内容提取到c:\wamp\bin\apache\Apache2.2.21\modules\中,然后
  4. 编辑httpd.conf并添加如下行:LoadModule wsgi_module modules/mod_wsgi.so
  5. 重新启动apache,然后可以继续django开发。

小结:所有东西(apache和mod_wsgi)都必须是64位的,才能在64位的窗口上运行apache/mod_wsgi。

据我所知。。。

Currently no official 64bit versions of Apache and PHP exists for Microsoft Windows.

然而,在编写本文时,有一个人至少为我们编译了Apache 2.2.19 x64,您可以download here.

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

此外,即使您让Apache x64在Windows上运行良好,您打算对mod_wsgi做些什么?正是因为这个原因,我决定创建一个Arch Linux灯堆栈。我现在可以很好地工作了,但是由于Aptana与Django项目不同步,所以我再次研究Windows解决方案。

如果你找到一个好的解决方案,请告诉我!

编辑:我找到了these 64-bit mod_wsgi's for py2.6 and 2.7,但我还没有让他们工作。

编辑:是的!我成功了!我的Apache服务监视器亮起绿灯,现在显示为Apache/2.2.19(Win64)mod_wsgi/3.3 Python/2.6.4。我使用2.6.4是因为这是Autodesk Maya正在运行的版本,为了保持一致性,我希望保持相同的版本。

相关问题 更多 >