centos7.5 部署flask+nginx+uwsgi+python3

centos7.5 部署flask+nginx+uwsgi+python3 html

## uwsgi
[uwsgi]
master = true
max-requests = 6000
processes = 6
threads = 6
chmod-socket = 664
thunder-lock = true
buffer-size = 32768
# 項目的根目錄
home = /root/zhijian/python
# 項目的啓動文件
wsgi-file = manager.py
callable = app
# 虛擬環境所在的相對路徑的位置
venv = /root/zhijian/py3
socket = 127.0.0.1:8001
# 日誌存放地
log-x-forwarded-for = true
logto = /root/zhijian/ulogs/uwsgi_web.logvue

## nginx----vi /etc/nginx/nginx.confpython

server {
listen       80;
server_name  39.98.188.73;
root         /usr/share/nginx/html;nginx

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;web

location / {
include      uwsgi_params;
uwsgi_pass   0.0.0.0:8001;  # 指向uwsgi 所應用的內部地址,全部請求將轉發給uwsgi 處

uwsgi_param UWSGI_PYHOME /root/zhijian/py3; # 指向虛擬環境目錄
}
}shell

# 在阿里雲上申請域名---主要域名添加二級域名----申請ssl 證書flask

配置flask+vue注意事項 1.vue----config/index.jscentos

2 nginx--nginx.confapp

 

 

 

#user root;socket

#user root nginx;

 

***裝不上uwsgi

pip安裝uwsgi失敗解決缺乏一個python-devel包yum源上下載安裝對應python版本的python-develyum install shiboken-python36-devel.x86_64

 

 ========= vi run.sh uwsgi -d --ini uwsgi.ini ========= sh run.sh ---shell執行命令

相關文章
相關標籤/搜索