ubuntu+uwsgi+nginx+django 部署手記一(uwsgi部分)

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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章