烧瓶 - WSGI进程不断崩溃 [英] Flask - WSGI process keeps crashing

查看:417
本文介绍了烧瓶 - WSGI进程不断崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试部署Flask应用程序(v0.8)时出现奇怪的错误。我正在使用Apache的mod_wsgi,建议在文档(几乎给信)。奇怪的是,在一些请求(简单地通过浏览器访问 / ),应用程序加载正常,但我经常得到资源加载错误(无法获取一些CSS或图像),错误日志显示类似于脚本标题的过早结束:myapp.wsgi 。有时apache崩溃与内部服务器错误。我试图去追究这个问题,但不知道是什么原因。我的wsgi文件看起来很简单:

  from myapp导入应用程序作为应用程序

任何线索从哪里开始看?

解决方案

获取脚本头的提前结束,您使用的是守护进程模式,而守护进程正在崩溃,出现seg错误或类似错误。



确保您还没有加载mod_python。

另请尝试设置:

  WSGIApplicationGroup%{GLOBAL} 

解决了Python C扩展模块对于子解释器不安全的问题。



请参阅:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues



并查找各种崩溃列出的原因。


I get strange errors when trying to deploy a Flask app (v0.8). I'm using apache's mod_wsgi, as suggested in the docs (almost to the letter). What's strange is that on some requests (simply accessing / via browser), the application loads fine, but very often I get a resource load errors (can't fetch some css or image), and the error log shows something like Premature end of script headers: myapp.wsgi. Sometimes apache crashes with Internal Server Error. I'm trying to chase the problem but could not figure out what's the cause. My wsgi file looks simple:

from myapp import app as application

Any clues where to start looking?

解决方案

If you are getting Premature end of script headers, you are using daemon mode and the daemon process is crashing with a seg fault or similar.

Make sure you aren't still loading mod_python.

Also try setting:

WSGIApplicationGroup %{GLOBAL}

to work around issues with Python C extension modules which aren't safe for sub interpreters.

See:

http://code.google.com/p/modwsgi/wiki/ApplicationIssues

and look for various reasons for crashes listed.

这篇关于烧瓶 - WSGI进程不断崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆