django1.11.6+nginx1.12.2+uwsgi2.0.15 部署
生活随笔
收集整理的這篇文章主要介紹了
django1.11.6+nginx1.12.2+uwsgi2.0.15 部署
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
安裝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命令啟動(dòng):?uwsgi?--http?:8001?--chdir?/opt/autoops/?-w?autoops.wsgi?--static-map=/static=staticvim??????uwsgi.ini
[uwsgi]
#?項(xiàng)目目錄
chdir=/opt/autoops/
#?指定項(xiàng)目的application
module=autoops.wsgi:application
#?進(jìn)程個(gè)數(shù)
workers=8
pidfile=/opt/autoops/script/uwsgi.pid
#?指定IP端口
#http=0.0.0.0:8003????##可以不啟用,利用socket文件,如果只是測(cè)試,需要啟用
#?指定靜態(tài)文件
static-map=/static=/opt/autoops/static
#?啟動(dòng)uwsgi的用戶(hù)名和用戶(hù)組
uid=root
gid=root
#?啟用主進(jìn)程
master=true
#?自動(dòng)移除unix?Socket和pid文件當(dāng)服務(wù)停止的時(shí)候
vacuum=true
#?序列化接受的內(nèi)容,如果可能的話(huà)
thunder-lock=true
#?啟用線(xiàn)程
enable-threads=true
#?設(shè)置自中斷時(shí)間
harakiri=30
#?設(shè)置緩沖
post-buffering=4096
#?設(shè)置日志目錄
daemonize=/opt/autoops/script/uwsgi.log
#?指定sock的文件路徑
socket=/opt/autoops/script/uwsgi.sockuwsgi?--ini?uwsgi.ini???#?啟動(dòng)uwsgi配置
uwsgi?--stop?script/uwsgi.pid?#?關(guān)閉uwsgi
uwsgi?--reload??script/uwsgi.pid??#重新加載
附:安裝mysql ?可以參考?http://hequan.blog.51cto.com/5701886/1982428
轉(zhuǎn)載于:https://blog.51cto.com/hequan/1982769
與50位技術(shù)專(zhuān)家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的django1.11.6+nginx1.12.2+uwsgi2.0.15 部署的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: loadrunner通过使用libmys
- 下一篇: zookeeper搭建