【问题标题】:Apache2 and mod_wsgi: Truncated or oversized response headers received from daemon processApache2 和 mod_wsgi:从守护进程收到的截断或过大的响应标头
【发布时间】:2015-06-20 12:55:43
【问题描述】:

我的应用程序在使用 mod_wsgi、Flask 和 Python 2.7 的 Apache 2 服务器上运行。奇怪的是,当页面刷新时应用程序崩溃了。对我来说,这恰好发生在其他每次刷新时。你可以看到它here。此外,在 Chrome 中,如果我打开网络检查器工具,程序确实不会崩溃。

在日志中,我看到:

[Tue Apr 14 13:45:29.137444 2015] [wsgi:error] [pid 32713] [client 146.203.54.32:58816] Truncated or oversized response headers received from daemon process 'localhost:80': /etc/g2e/htdocs/g2e
[Tue Apr 14 13:45:29.671493 2015] [core:notice] [pid 28845] AH00052: child pid 640 exit signal Segmentation fault (11)
[Tue Apr 14 13:45:29.671520 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' has died, deregister and restart it.
[Tue Apr 14 13:45:29.671524 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' terminated by signal 11
[Tue Apr 14 13:45:29.671527 2015] [wsgi:info] [pid 28845] mod_wsgi (pid=640): Process 'localhost:80' has been deregistered and will no longer be monitored.
...

FWIW,我正在使用

Linux 3.16.7-7-desktop #1 SMP PREEMPT Wed Dec 17 18:00:44 UTC 2014 (762f27a) x86_64 x86_64 x86_64 GNU/Linux

感谢任何帮助。

【问题讨论】:

  • 关于 mod_wsgi 邮件列表的讨论是groups.google.com/forum/#!topic/modwsgi/JdSAnqoJDTw
  • 我认为回答我的问题不公平,因为我自己没有正确解决问题。但是 FWIW,我无法使用 Graham 的建议解决问题,并且由于服务器已经投入生产,我担心摆弄太多。我最终使用 Docker 并安装了 Apache、mod_wsgi 等。

标签: apache flask apache2 mod-wsgi


【解决方案1】:

我可能有一些调整。我有这个问题,但现在它以某种方式工作。

  • 我尝试将mod_wsgi 作为守护进程运行。我的应用程序无法运行,并且我在日志中有此错误消息。
  • 例如,将 mod_wsgi 作为非守护进程运行是可行的

    python manage.py runmodwsgi --reload-on-changes # for Django
    

    所以我再次启动它然后杀死它。

  • 我的应用程序仍在运行 :)

(mod_wsgi 4.4.[1-13]、apache2、python 2.7、Django 1.7、Debian8 全新安装,带或不带 virtualenv)

【讨论】:

  • Welp,守护模式至少是生产环境中的推荐配置。
猜你喜欢
  • 2014-09-09
  • 1970-01-01
  • 2017-11-08
  • 1970-01-01
  • 1970-01-01
  • 2023-01-12
  • 1970-01-01
  • 2017-01-13
  • 1970-01-01
相关资源
最近更新 更多