【问题标题】:apache mod_wsgi crashes only in daemon modeapache mod_wsgi 仅在守护程序模式下崩溃
【发布时间】:2012-10-12 06:41:23
【问题描述】:

我使用 apache webserver 和 mod_python 作为我的界面。我正在从 mod_python 迁移到 mod_wsgi。我已经完成了所有设置,一切正常。现在,当我添加以下行(以启用守护程序模式)时,该站点无法正常工作。

WSGIDaemonProcess test.tessite.com processes=5 threads=10 display-name=%{GROUP}

我收到来自服务器的 500 错误响应。当我查看 Apache 的错误日志时,我有以下情况,

[Mon Oct 22 12:31:07 2012] [error] [client 58.68.24.230] Premature end of script headers: ls.wsgi

这是我在 conf 中设置的 WSGI,

#Set the number of process and threads for each process. process*thread number of requests can be handled at a time
WSGIDaemonProcess test.testsite.com processes=5 threads=10 display-name=%{GROUP}
#Sets which process group WSGI application is assigned to.
WSGIProcessGroup test.testsite.com
#Maps a URL to a filesystem location and designates the target as a WSGI script.
WSGIScriptAlias / /public/gdp/trunk/src/ukl/lis/process/ls.wsgi
<Directory /public/gdp/trunk/src/ukl/lis/process/>
    Order allow,deny
    Allow from all
</Directory>

为什么这只发生在守护进程模式下?如何解决这个问题?在非守护模式下运行是否安全?

【问题讨论】:

  • 你要做的第一件事是确定它是否与mod_python发生冲突。注释掉和 mod_python 指令并禁用 mod_python 的加载。然后重新测试,看看是否仍然出现。这样你就可以缩小原因。

标签: python django apache mod-wsgi


【解决方案1】:

查看https://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions,“Apache 进程崩溃”部分,最后一个问题。 mod_python apache 模块是否仍然加载?您是否在使用任何具有 C 组件的第三方库?

【讨论】:

  • 这确实很奇怪。你可以尝试一个“hello world”的 WSGI 应用程序,看看它是否有效?如果,如果您加载您在真实应用程序中使用的所有库,它仍然有效吗?您能否确认您的 WSGI 进程实际上正在崩溃(进程号是否更改?)
猜你喜欢
  • 2013-02-04
  • 2011-05-09
  • 2015-07-10
  • 1970-01-01
  • 2017-05-20
  • 1970-01-01
  • 1970-01-01
  • 2011-07-18
  • 2012-03-20
相关资源
最近更新 更多