如何解决FastCGI 随机崩溃
我目前在 Bluehost 上托管了一个网站。我使用 Flask 创建它并使用 FastCGI。诚然,我是部署 Flask 的新手,之前我没有使用过 FastCGI。有时,当我访问该网站时,它表现得很好;没有错误。但其他时候,它不会工作,并会给出 500 内部服务器错误。我检查了 Bluehost 网站上的错误日志,列出的所有内容如下:
[2021-05-08 17:56:00]: uid: (3565/myusername) gid: (3567/myusername) cmd: main.fcgi
我无法找到崩溃时的模式。
以下是相关文件供参考:
.htaccess:
Options +ExecCGI
AddHandler fcgid-script .fcgi
RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} !=/home1/myusername/public_html/main.fcgi
#RewriteRule ^(.*)$ /home1/myusername/public_html/main.fcgi/$1 [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /home1/myusername/public_html/main.fcgi/$1 [L]
main.fcgi:
#!/home1/myusername/path/to/my/venv/bin/python3
from flup.server.fcgi import WSGIServer
from main import app as application
import sys
WSGIServer(application).run()
就像我说的,我是 FastCGI 的新手,所以如果你能在这方面给我任何帮助,那就太棒了。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。