django1.11.6+nginx1.12.2+uwsgi2.0.15 部署
生活随笔
收集整理的這篇文章主要介紹了
django1.11.6+nginx1.12.2+uwsgi2.0.15 部署
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
安裝python3.6yum?-y?install?xz?wget?gcc?make?gdbm-devel?openssl-devel?sqlite-devel?zlib-devel?bzip2-devel
wget?http://mirrors.sohu.com/python/3.6.3/Python-3.6.3.tar.xz
tar?-xf?Python-3.6.3.tar.xz
cd?Python-3.6.3./configure?--enable-shared?--enable-loadable-sqlite-extensions?--with-zlib???
./configure?--enable-optimizations
make?&&?make?installmv?/usr/bin/python?/usr/bin/python2.7
ln?-s?/usr/local/bin/python3?/usr/bin/pythonvim?/etc/ld.so.conf
/usr/local/lib
include?ld.so.conf.d/*.conf
/sbin/ldconfigpython?–Vvim?/usr/bin/yum
#!/usr/bin/python2.7修改源
/root/.pip/pip.conf
[global]
index-url?=?http://pypi.douban.com/simple
trusted-host?=?pypi.douban.compip3?????install?uwsgi??django命令啟動:?uwsgi?--http?:8001?--chdir?/opt/autoops/?-w?autoops.wsgi?--static-map=/static=staticvim??????uwsgi.ini
[uwsgi]
#?項目目錄
chdir=/opt/autoops/
#?指定項目的application
module=autoops.wsgi:application
#?進程個數
workers=8
pidfile=/opt/autoops/script/uwsgi.pid
#?指定IP端口
#http=0.0.0.0:8003????##可以不啟用,利用socket文件,如果只是測試,需要啟用
#?指定靜態文件
static-map=/static=/opt/autoops/static
#?啟動uwsgi的用戶名和用戶組
uid=root
gid=root
#?啟用主進程
master=true
#?自動移除unix?Socket和pid文件當服務停止的時候
vacuum=true
#?序列化接受的內容,如果可能的話
thunder-lock=true
#?啟用線程
enable-threads=true
#?設置自中斷時間
harakiri=30
#?設置緩沖
post-buffering=4096
#?設置日志目錄
daemonize=/opt/autoops/script/uwsgi.log
#?指定sock的文件路徑
socket=/opt/autoops/script/uwsgi.sockuwsgi?--ini?uwsgi.ini???#?啟動uwsgi配置
uwsgi?--stop?script/uwsgi.pid?#?關閉uwsgi
uwsgi?--reload??script/uwsgi.pid??#重新加載
附:安裝mysql ?可以參考?http://hequan.blog.51cto.com/5701886/1982428
轉載于:https://blog.51cto.com/hequan/1982769
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的django1.11.6+nginx1.12.2+uwsgi2.0.15 部署的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: loadrunner通过使用libmys
- 下一篇: zookeeper搭建