无法让我的Apache与mod\wsgi一起工作

2024-03-28 17:33:32 发布

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

根据指南,我下载了mod_wsgi-win32-ap22py27-3.3.so,并将其重命名为mod_wsgi.so公司并将其放入Apache的/modules文件夹中。在

接下来,我添加了'loadmodulewsgi'u modules/mod_wsgi.so公司'到httpd.conf一

当启动Apache时,它告诉我一个错误:“请求的操作失败了!”在

这是错误.log公司名称:

Starting the Apache2.2 service
The Apache2.2 service is running.
] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Fri Oct 07 12:59:37 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 12:59:37 2016] [notice] Parent: Created child process 3420
[Fri Oct 07 12:59:38 2016] [notice] Child 3420: Child process is running
[Fri Oct 07 12:59:38 2016] [notice] Child 3420: Acquired the start mutex.
[Fri Oct 07 12:59:38 2016] [notice] Child 3420: Starting 64 worker threads.
[Fri Oct 07 12:59:38 2016] [notice] Child 3420: Starting thread to listen on port 80.
[Fri Oct 07 12:59:58 2016] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Fri Oct 07 12:59:59 2016] [error] [client 127.0.0.1] File does not exist: C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/favicon.ico
[Fri Oct 07 13:01:05 2016] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Fri Oct 07 13:01:05 2016] [notice] Child 3420: Exit event signaled. Child process is ending.
[Fri Oct 07 13:01:06 2016] [notice] Child 3420: Released the start mutex
[Fri Oct 07 13:01:07 2016] [notice] Child 3420: All worker threads have exited.
[Fri Oct 07 13:01:07 2016] [notice] Child 3420: Child process is exiting
[Fri Oct 07 13:01:07 2016] [notice] Parent: Child process exited successfully.
[Fri Oct 07 13:07:27 2016] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Oct 07 13:07:27 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 13:07:27 2016] [notice] Apache/2.2.25 (Win32) mod_wsgi/3.3 Python/2.7.11 configured -- resuming normal operations
[Fri Oct 07 13:07:27 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 13:07:27 2016] [notice] Parent: Created child process 7712
[Fri Oct 07 13:07:28 2016] [warn] mod_wsgi: Compiled for Python/2.7.
[Fri Oct 07 13:07:28 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 13:07:28 2016] [notice] Child 7712: Child process is running
ImportError: No module named site
[Fri Oct 07 13:07:28 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Fri Oct 07 13:42:17 2016] [notice] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Fri Oct 07 13:42:17 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 13:42:17 2016] [notice] Parent: Created child process 5752
[Fri Oct 07 13:42:17 2016] [notice] Child 5752: Child process is running
[Fri Oct 07 13:42:17 2016] [notice] Child 5752: Acquired the start mutex.
[Fri Oct 07 13:42:17 2016] [notice] Child 5752: Starting 64 worker threads.
[Fri Oct 07 13:42:17 2016] [notice] Child 5752: Starting thread to listen on port 80.
[Fri Oct 07 13:42:28 2016] [notice] Parent: Received restart signal -- Restarting the server.
[Fri Oct 07 13:42:28 2016] [notice] Child 5752: Exit event signaled. Child process is ending.
[Fri Oct 07 13:42:28 2016] [notice] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Fri Oct 07 13:42:28 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 13:42:28 2016] [notice] Parent: Created child process 5828
[Fri Oct 07 13:42:28 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Fri Oct 07 13:42:28 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 13:42:28 2016] [notice] Child 5828: Child process is running
ImportError: No module named site
[Fri Oct 07 13:42:28 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Fri Oct 07 13:42:29 2016] [notice] Child 5752: Released the start mutex
[Fri Oct 07 13:42:30 2016] [notice] Child 5752: All worker threads have exited.
[Fri Oct 07 13:42:30 2016] [notice] Child 5752: Child process is exiting
[Fri Oct 07 13:43:17 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Fri Oct 07 13:43:17 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 13:43:17 2016] [notice] Apache/2.2.25 (Win32) mod_wsgi/4.4.12 Python/2.7.11 configured -- resuming normal operations
[Fri Oct 07 13:43:17 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 13:43:17 2016] [notice] Parent: Created child process 1200
[Fri Oct 07 13:43:17 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Fri Oct 07 13:43:17 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 13:43:17 2016] [notice] Child 1200: Child process is running
ImportError: No module named site
[Fri Oct 07 13:43:17 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Fri Oct 07 14:01:14 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Fri Oct 07 14:01:14 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 14:01:14 2016] [notice] Apache/2.2.25 (Win32) mod_wsgi/4.4.12 Python/2.7.11 configured -- resuming normal operations
[Fri Oct 07 14:01:14 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 14:01:14 2016] [notice] Parent: Created child process 6128
[Fri Oct 07 14:01:14 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Fri Oct 07 14:01:14 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Fri Oct 07 14:01:14 2016] [notice] Child 6128: Child process is running
ImportError: No module named site
[Fri Oct 07 14:01:14 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Fri Oct 07 14:01:24 2016] [notice] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Fri Oct 07 14:01:24 2016] [notice] Server built: Jul 10 2013 01:52:12
[Fri Oct 07 14:01:24 2016] [notice] Parent: Created child process 8268
[Fri Oct 07 14:01:24 2016] [notice] Child 8268: Child process is running
[Fri Oct 07 14:01:24 2016] [notice] Child 8268: Acquired the start mutex.
[Fri Oct 07 14:01:24 2016] [notice] Child 8268: Starting 64 worker threads.
[Fri Oct 07 14:01:24 2016] [notice] Child 8268: Starting thread to listen on port 80.
[Fri Oct 07 14:01:29 2016] [notice] Parent: Received shutdown signal -- Shutting down the server.
[Fri Oct 07 14:01:29 2016] [notice] Child 8268: Exit event signaled. Child process is ending.
[Fri Oct 07 14:01:30 2016] [notice] Child 8268: Released the start mutex
[Fri Oct 07 14:01:31 2016] [notice] Child 8268: All worker threads have exited.
[Fri Oct 07 14:01:31 2016] [notice] Child 8268: Child process is exiting
[Fri Oct 07 14:01:31 2016] [notice] Parent: Child process exited successfully.
[Mon Oct 10 09:37:29 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Mon Oct 10 09:37:29 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Mon Oct 10 09:37:29 2016] [notice] Apache/2.2.25 (Win32) mod_wsgi/4.4.12 Python/2.7.11 configured -- resuming normal operations
[Mon Oct 10 09:37:29 2016] [notice] Server built: Jul 10 2013 01:52:12
[Mon Oct 10 09:37:29 2016] [notice] Parent: Created child process 1012
[Mon Oct 10 09:37:29 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Mon Oct 10 09:37:29 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Mon Oct 10 09:37:29 2016] [notice] Child 1012: Child process is running
ImportError: No module named site
[Mon Oct 10 09:37:29 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Mon Oct 10 09:37:55 2016] [notice] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Mon Oct 10 09:37:55 2016] [notice] Server built: Jul 10 2013 01:52:12
[Mon Oct 10 09:37:55 2016] [notice] Parent: Created child process 6368
[Mon Oct 10 09:37:55 2016] [notice] Child 6368: Child process is running
[Mon Oct 10 09:37:55 2016] [notice] Child 6368: Acquired the start mutex.
[Mon Oct 10 09:37:55 2016] [notice] Child 6368: Starting 64 worker threads.
[Mon Oct 10 09:37:55 2016] [notice] Child 6368: Starting thread to listen on port 80.
[Mon Oct 10 09:38:14 2016] [notice] Parent: Received restart signal -- Restarting the server.
[Mon Oct 10 09:38:14 2016] [notice] Child 6368: Exit event signaled. Child process is ending.
[Mon Oct 10 09:38:15 2016] [notice] Apache/2.2.25 (Win32) configured -- resuming normal operations
[Mon Oct 10 09:38:15 2016] [notice] Server built: Jul 10 2013 01:52:12
[Mon Oct 10 09:38:15 2016] [notice] Parent: Created child process 7484
[Mon Oct 10 09:38:15 2016] [warn] mod_wsgi: Compiled for Python/2.7.9+.
[Mon Oct 10 09:38:15 2016] [warn] mod_wsgi: Runtime using Python/2.7.11.
[Mon Oct 10 09:38:15 2016] [notice] Child 7484: Child process is running
ImportError: No module named site
[Mon Oct 10 09:38:15 2016] [crit] (OS 1813)Der angegebene Ressourcentyp wurde nicht in der Image-Datei gefunden.  : master_main: create child process failed. Exiting.
[Mon Oct 10 09:38:15 2016] [warn] (OS 995)Der E/A-Vorgang wurde wegen eines Threadendes oder einer Anwendungsanforderung abgebrochen.  : winnt_accept: Asynchronous AcceptEx failed.
[Mon Oct 10 09:38:15 2016] [notice] Child 6368: Released the start mutex
[Mon Oct 10 09:38:16 2016] [notice] Child 6368: All worker threads have exited.
[Mon Oct 10 09:38:16 2016] [notice] Child 6368: Child process is exiting

我不确定问题到底出在哪里,因为mod\uwsg是针对python2.7的,除了apache2.2(32位)之外,我还使用python2.7(32位)。在


Tags: themodchildwsgiisapacheprocessrunning
1条回答
网友
1楼 · 发布于 2024-03-28 17:33:32

解决了这个问题。在

我必须为它设置环境变量PYTHONHOME和PYTHONPATH来修复“ImportError:No module named site”错误。在

set PYTHONHOME=c:\Python27
set PYTHONPATH=c:\Python27\Lib
set PATH=%PYTHONHOME%;%PATH%

相关问题 更多 >