uwsgi
nginx部署部分詳見:https://blog.csdn.net/weixin_33127753/article/details/81457624
- 項目配置文件uwsgi.ini
# uwsgi.ini file
[uwsgi]
# Django-related settings
# the base directory (full path)
chdir = /your/project/PATH
# Django's wsgi file
module = yourprojectNAME.wsgi
# process-related settings
# master
master = true
# maximum number of worker processes
processes = 3
#buffer-size = 65536
# the socket (use the full path to be safe
#socket = /your/project/PATH/mysite.sock
#socket = 127.0.0.1:8000
http = your machine's IP:8000
# ... with appropriate permissions - may be needed
chmod-socket = 666
# clear environment on exit
vacuum = true
# logto = /tmp/mylog.log
# 存儲pid進程
pidfile =uwsgi0.pid
# 存儲uwsgi狀態
stats =uwsgi.status
#後臺運行,存儲log
daemonize =uwsgi.log
- 啓動
uwsgi -i uwsgi.ini
- 停止
#查看進程號
cat uwsgi.pid
#停止進程
uwsgi --stop uwsgi.pid
kill pid
- 服務器開機自啓動
#編輯文件/etc/rc.local, 添加下面內容到這行代碼之前exit 0:
/usr/local/bin/uwsgi --ini /your/project/path/uwsgi.ini