windows 64位Windows下将mod_wsgi模块加载到apache的问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6093727/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Problem of loading mod_wsgi module into apache on Windows 64-bit
提问by Protocole
I'm trying to install mod_wsgi module followed this instruction. I've downloaded mod_wsgi.so from this source. It seems like apache cannot restart services properly and the page cannot be loaded after I added the following line to httpd.conf
我正在尝试按照此说明安装 mod_wsgi 模块。我已经从这个来源下载了 mod_wsgi.so 。在我将以下行添加到 httpd.conf 后,似乎 apache 无法正确重启服务并且无法加载页面
LoadModule wsgi_module modules/mod_wsgi.so
LoadModule wsgi_module modules/mod_wsgi.so
I've checked some issues from some sources as follows:
我从一些来源检查了一些问题,如下所示:
- The file name is correct - mod_wsgi.so not mod_wsgi.so.so
- Permissions on the file was set as same as other modules that loaded properly
- Python installed for all users
- 文件名正确 - mod_wsgi.so 不是 mod_wsgi.so.so
- 该文件的权限设置为与正确加载的其他模块相同
- 为所有用户安装 Python
Environment:
环境:
- Windows Server? Standard FE 64-bit
- Apache 2.2.8 on WAMP 2.0
- Python 2.7.1 installed for all users
- 视窗服务器?标准 FE 64 位
- WAMP 2.0 上的 Apache 2.2.8
- 为所有用户安装了 Python 2.7.1
Without loading this module, apache runs properly. What is my problem?
没有加载这个模块,apache 可以正常运行。我的问题是什么?
Application 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.
From apache error.log, is it clear that installed apache is 32-bit?
从 apache error.log 中,是否清楚安装的 apache 是 32 位的?
Soulution:Change everything to 64-bit.
解决方案:将所有内容更改为 64 位。
回答by Peter
I was faced with this situation as well, and Apache would run on windows 64bit, but won't if mod_wsgi is loaded.
我也遇到过这种情况,Apache 可以在 Windows 64 位上运行,但如果加载了 mod_wsgi,则不会。
I found a solution which is pretty simple:
我找到了一个非常简单的解决方案:
- Download and install a 64-bit version of Apache which is easily handled if you download and install from http://wampserver.com/
- Download mod_wsgi from this page
- Extract the content of the downloaded zipped file into
c:\wamp\bin\apache\Apache2.2.21\modules\
and - Edit
httpd.conf
and add a line like:LoadModule wsgi_module modules/mod_wsgi.so
- Restart apache and you can then continue your django development.
- 下载并安装 64 位版本的 Apache,如果您从http://wampserver.com/下载并安装,则很容易处理
- 从此页面下载 mod_wsgi
- 解压下载的压缩文件的内容转换成
c:\wamp\bin\apache\Apache2.2.21\modules\
和 - 编辑
httpd.conf
并添加如下一行:LoadModule wsgi_module modules/mod_wsgi.so
- 重启 apache,然后你就可以继续你的 django 开发了。
Summary: Everything (both apache and mod_wsgi) has to be 64bit for you to be able to run Apache/mod_wsgi on a 64-bit windows.
总结:一切(apache 和 mod_wsgi)都必须是 64 位的,你才能在 64 位 Windows 上运行 Apache/mod_wsgi。
回答by Jim Paul
I got Apache/Mod_wsgi running on a Windows 2008 server.
我在 Windows 2008 服务器上运行了 Apache/Mod_wsgi。
The link to the 64 bit version of Apache provided by Peter is broken. I found one that worked for me at:
Peter 提供的 64 位版本 Apache 的链接已断开。我找到了一个对我有用的:
http://www.apachelounge.com/download/win64/
http://www.apachelounge.com/download/win64/
Read the readme.txt. The install is very simple.
阅读 readme.txt。安装非常简单。
His link to the 64 bit mod_wsgi is still good:
他的 64 位 mod_wsgi 链接还是不错的:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
http://www.lfd.uci.edu/~gohlke/pythonlibs/#mod_wsgi
I used an win-amd64 version just fine and I think the hardware I'm on is Intel.
我使用了 win-amd64 版本就好了,我认为我使用的硬件是 Intel。
I made sure the Apache and Mod_wsgi versions matched as did the python version. I believe the mod_wsgi version I used was 3.3.
我确保 Apache 和 Mod_wsgi 版本与 python 版本匹配。我相信我使用的 mod_wsgi 版本是 3.3。
回答by jedmao
From what I understand...
据我了解...
Currently no official 64bit versions of Apache and PHP exists for Microsoft Windows.
However, there is a dude out there who, at the time of writing this, has at least compiled Apache 2.2.19 x64for us, which you can download here.
但是,在撰写本文时,有一个人至少为我们编译了Apache 2.2.19 x64,您可以在此处下载。
If you want a newer version, you'd have to compile it yourself, but that would be quite the undertaking!
如果你想要一个更新的版本,你必须自己编译它,但这将是一项艰巨的任务!
Furthermore, even if you doget Apache x64 running nicely on Windows, what do you intend to do about mod_wsgi? This is the very reason I decided to just create an Arch Linux LAMP stack for this very purpose. I have it working fine now, but since Aptana doesn't sync with Django projects I'm looking into the Windows solutions again.
此外,即使您确实让 Apache x64 在 Windows 上运行良好,您打算对 mod_wsgi 做什么?这就是我决定为此目的创建 Arch Linux LAMP 堆栈的真正原因。我现在工作正常,但由于 Aptana 不与 Django 项目同步,我正在再次研究 Windows 解决方案。
Please, let me know if you find a good solution!
请让我知道您是否找到了好的解决方案!
EDIT: I found these 64-bit mod_wsgi's for py2.6 and 2.7, but I have yet to get them working.
编辑:我为 py2.6 和 2.7找到了这些 64 位 mod_wsgi,但我还没有让它们工作。
EDIT: Yes! I got it working! My Apache Service Monitor has a green light and now says Apache/2.2.19 (Win64) mod_wsgi/3.3 Python/2.6.4. I'm using 2.6.4 because that's what Autodesk Maya is running and I want to keep the same version for consistency.
编辑:是的!我让它工作了!我的 Apache 服务监视器亮起绿灯,现在显示 Apache/2.2.19 (Win64) mod_wsgi/3.3 Python/2.6.4。我使用的是 2.6.4,因为这是 Autodesk Maya 正在运行的版本,我希望保持相同的版本以保持一致性。