03月23, 2017

Linux服务器部署之填坑(三)uwsgi安装和运行错误

uwsgi官方文档

根据Django官方文档, 推荐使用pip install uwsgi安装, 尤其是django启动的python版本与os 附带的python不一样时

"you need a C compiler to build uWSGI"

uwsgi安装缺少C Compiler错误, 安装C Compiler

yum groupinstall "Development Tools"

can't open file 'uwsgi': [Errno 2] No such file or directory

运行uwsgi 出现错误can't open file 'uwsgi'

启动uwsgi --ini 命令后程序停止并出现can't open file 'uwsgi'错误 检查并比较直接启动flask的输出后发现DEBUG模式仍然在打开,DEBUG=False后一切正常

same port has been used by another process

yum 或者pip安装的uwsgi只能有一套,否则有冲突

No module named site

在supervisord启动时出现错误消息 No module named site, 但是用uwsgi独立启动时没有该错误 这是因为supervisord启动子进程时没有找到Python路径,需要在supervisord.conf增加PYTHONPATH

[program:apache2]
command=/home/chrism/bin/httpd -c "ErrorLog /dev/stdout" -DFOREGROUND
user=chrism
environment=HOME="/home/chrism",USER="chrism"

本文链接:http://57km.cc/post/you need a C compiler to build uWSGI.html

-- EOF --

Comments