第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

centos7.4下配置django+uwsgi+nginx

標(biāo)簽:
深度學(xué)習(xí)

centos7.4下配置django1.11+uwsgi2.0+nginx-1.5.6.
安装django
https://img1.sycdn.imooc.com//5b3b75490001b7b808010325.jpg
安装uwsgi
https://img1.sycdn.imooc.com//5b3b7541000154c509000296.jpg

运行出现错误:

You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run ‘python manage.py migrate’ to apply them.

https://img1.sycdn.imooc.com//5b3b7536000182b509670323.jpg

运行语句,再次执行,OK :python manage.py migrate

https://img1.sycdn.imooc.com//5b3b752c0001060809280483.jpg
创建app
https://img1.sycdn.imooc.com//5b3b75210001097c09390263.jpg
执行
uwsgi –http :8008 –chdir /home/kmind –wsgi-file kmind/wsgi.py –master –processes 4 –threads 2 –stats 127.0.0.1:9192
https://img1.sycdn.imooc.com//5b3b751600018f8516470642.jpg

再次运行成功:
https://img1.sycdn.imooc.com//5b3b750c0001e75814150411.jpg
鉴于后面跟的参数较多,我们可以将这些参数放在一个ini文件中,当然,uwsgi支持多种类型的配置文件,如xml,ini等。此处,使用ini类型的配置。  
在hello项目目录下创建hello_uwsgi.ini文件,文件内容如下:

# hello_uwsgi.ini file[uwsgi]# Django-related settingshttp = :8008# the base directory (full path)chdir           = /home/kmind# Django s wsgi filemodule          = kmind.wsgi# process-related settings# mastermaster          = true# maximum number of worker processesprocesses       = 4# ... with appropriate permissions - may be needed# chmod-socket    = 664# clear environment on exitvacuum          = true

此时执行如下命令:

uwsgi --ini kmind_uwsgi.ini

https://img1.sycdn.imooc.com//5b3b75020001a60a13250398.jpg

安装nginx

可以执行如下命令进行安装

cd /usr/local/
wget http://nginx.org/download/nginx-1.5.6.tar.gztar xf nginx-1.5.6.tar.gzcd nginx-1.5.6./configure 
make && make install

https://img1.sycdn.imooc.com//5b3b74f90001b40709560306.jpg
./configure 出现错误:
https://img1.sycdn.imooc.com//5b3b74ef000126a009320136.jpg
执行下面语句

 yum -y install openssl openssl-devel1

再次执行

./configure 
make && make install12

https://img1.sycdn.imooc.com//5b3b74e40001945912660488.jpg

将nginx与uwsgi以及django结合

执行如下命令来修改nginx.conf文件

vim /usr/local/nginx/conf/nginx.conf1

https://img1.sycdn.imooc.com//5b3b74d90001466304880278.jpg

主要修改如上图所示:  
listen端口改为8092  
在location中添加:

include uwsgi_params;  
uwsgi_pass 127.0.0.1:8008;(端口要与ini中的端口一致)
执行如下命令来启动:

uwsgi --ini /home/kmind/kmind_uwsgi.ini & /usr/local/nginx/sbin/nginx1

检验参数是否出现问题
https://img1.sycdn.imooc.com//5b3b74ce00012abc09410077.jpg
打开浏览器输入http://139.196.126.223:8008/,显示如下结果表示成功  
https://img1.sycdn.imooc.com//5b3b74c50001e75814150411.jpg

常用命令:
检测uwsgi进程:ps ax | grep uwsgi
网上有很多关闭的方法都试了不可以,只有reboot 关闭比较狠

nginx:
启动、停止nginx

// 查询 nginx 进程
[root@localhost sbin]# ps aux | grep nginx[root@localhost nginx-1.13.3]# cd /usrlocal/nginx/sbin/// 启动 nginx
[root@localhost sbin]# ./nginx// 停止 nginx(此方式相当于先查出nginx进程id再使用kill命令强制杀掉进程)
[root@localhost sbin]# ./nginx -s stop// 停止 nginx(此方式停止步骤是待nginx进程处理任务完毕进行停止)
[root@localhost sbin]# ./nginx -s quit// 从新加载配置文件(修改配置文件 nginx.conf 可以使用该命令使配置生效)
[root@localhost sbin]# ./nginx -s reload12345678910111213141516
cd /usr/local/nginx/sbin/
./nginx -s reload12

https://img1.sycdn.imooc.com//5b3b74bc00018c7009640123.jpg

域名绑定参考连接:
https://www.cnblogs.com/doseoer/p/5291739.html


點(diǎn)擊查看更多內(nèi)容
TA 點(diǎn)贊

若覺(jué)得本文不錯(cuò),就分享一下吧!

評(píng)論

作者其他優(yōu)質(zhì)文章

正在加載中
  • 推薦
  • 評(píng)論
  • 收藏
  • 共同學(xué)習(xí),寫(xiě)下你的評(píng)論
感謝您的支持,我會(huì)繼續(xù)努力的~
掃碼打賞,你說(shuō)多少就多少
贊賞金額會(huì)直接到老師賬戶(hù)
支付方式
打開(kāi)微信掃一掃,即可進(jìn)行掃碼打賞哦
今天注冊(cè)有機(jī)會(huì)得

100積分直接送

付費(fèi)專(zhuān)欄免費(fèi)學(xué)

大額優(yōu)惠券免費(fèi)領(lǐng)

立即參與 放棄機(jī)會(huì)
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)

舉報(bào)

0/150
提交
取消