編寫uwsgi.ini啟動uwsgi


安裝django后的uwsgi可以在根目錄設置:

新建uwsgi.ini文件,並填寫以下內容

[uwsgi]

#使用uwsgiweb訪問連接時使用
http=0.0.0.0:9000

#使用nginx連接時使用 socket=0.0.0.0:8900 master=true #項目目錄 chdir = /home/Report #項目目錄名 wsgi-file = Report/wsgi.py # maximum number of worker processes processes=4 threads=2 daemonize: /tmp/uwsgi.log pidfile: /tmp/uwsgi.pid disable-logging : true vacuum = true # 設置自中斷時間 harakiri = 300 # 設置緩沖 post-buffering = 6553600 http-timeout = 600
# 設置虛擬環境的路徑
virtualenv=/django/python/env/
#代碼更新立馬重載
py-autoreload = 1


然后執行

uwsgi --ini uwsgi.ini
后台運行:
uwsgi -d --ini uwsgi.ini



1.卸載uwsgi

pip uninstall uwsgi

#注意此時卸載,pip會有緩存留在系統里

2.安裝pcre支持庫

yum install pcre pcre-devel pcre-static

3.繼續安裝uwsgi,不走pip緩存

pip install uwsgi -I --no-cache-dir

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM