部署环境:nginx + uwsgi + flask + virtualenv
uwsgi 的安装
在 virtualenv 下使用 pip install uwsgi
安装 uwsgi
uwsgi.ini 的编写
[uwsgi]
app-name = dap
base = /var/www/python/web/Dap
# virtualenv path
home = %(base)/.env
# add project path to pythonpath
pythonpath = %(base)
# index file
wsgi-file = %(base)/dataProcess/dap/routes/index.py
callable = app
# http-socket = 0.0.0.0:9902
# tcp socket
socket = 0.0.0.0:9902
# unix socket file's location
socket = %(base)/uwsgi.sock
#permissions for the socket file
chmod-socket = 775
master = true
processes = 4
threads = 2
buffer-size = 32768
logto = %(base)/uwsgi.log
nginx + uwsgi 的配置
location /api_py {
include uwsgi_params;
uwsgi_pass unix:/var/www/python/web/Dap/uwsgi.sock;
}