如果尝试加载mod_wsgi,Apache服务器无法启动

时间:2014-01-10 18:01:24

标签: apache mod-wsgi

我正在尝试将项目从开发服务器移动到Apache服务器。

我在Windows 8.1 x64计算机和Python 2.7上运行

我安装了Apache 2.2.25 x86,一切顺利,服务器处于活动状态;然后我下载了预编译的mod_wsgi-3.4.ap22.win32-py2.7(x86版本以匹配Apache的版本)。

我将mod_wsgi.so移动到Apache安装的modules文件夹中,并将此行:LoadModule wsgi_module modules/mod_wsgi.so添加到httpd config;然后,当我尝试重新启动服务器时,它将无法保留此错误日志:

[Fri Jan 10 18:53:18 2014] [notice] Parent: Received restart signal -- Restarting the server.
[Fri Jan 10 18:53:18 2014] [notice] Child 9772: Exit event signaled. Child process is ending.
httpd.exe: Syntax error on line 130 of C:/Program Files (x86)/Apache Software Foundation/Apache2.2/conf/httpd.conf: Cannot load C:/Program Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so into server: **Impossible to find the specified module**
[Fri Jan 10 18:53:18 2014] [warn] (OS 995)**I/O operation terminated because of the thread's exit or the application's request.**  : winnt_accept: Asynchronous AcceptEx failed.
[Fri Jan 10 18:53:19 2014] [notice] Child 9772: Released the start mutex
[Fri Jan 10 18:53:20 2014] [notice] Child 9772: All worker threads have exited.
[Fri Jan 10 18:53:20 2014] [notice] Child 9772: Child process is exiting

注意:粗体(**)部分用我的母语,我只是翻译它们。

我确保该模块实际上被称为mod_wsgi.so,所以我无法真正看出问题出在哪里。

编辑:发现了问题。 Python(以及MySQL的pyton mod)是x64而不是x86。安装了两者的正确版本,它的工作正常。

1 个答案:

答案 0 :(得分:0)

关键似乎是:

Cannot load C:/Program Files (x86)/Apache Software Foundation/Apache2.2/modules/mod_wsgi.so into server: **Impossible to find the specified module**

这似乎很清楚。您的服务器上不存在该文件,或者如果该文件存在,Apache无法读取它。每个人都可以阅读吗?