編輯uwsgi.ini文件web
[uwsgi] http = 0.0.0.0:8000 chdir = /home/ubuntu/NewsBox/NewsBox_web wsgi-file = /home/ubuntu/NewsBox/NewsBox_web/NewsBox_web/wsgi.py processes = 2 #static-map = /static=/home/ubuntu/simpleblog/static
配置supervisor配置文件/etc/supervisor/supervisord.conf,添加以下配置ubuntu
[include] files = /etc/supervisor/conf.d/*.conf
在/etc/supervisor/conf.d/文件夾下添加配置文件xxx.confbash
[program:NewsBox] command=sudo /home/ubuntu/venv35_1/bin/uwsgi --ini /home/ubuntu/NewsBox.ini autostart=true autorestart=true startsecs=5 priority=1 stopasgroup=true killasgroup=true
切記,如已有服務啓動,記得更新supervisor服務!!!spa
sudo supervisorctl update