From c26f15ae69a4549a287ba2f2bfc0451c39cc9eeb Mon Sep 17 00:00:00 2001 From: zhengxinonly Date: Sat, 10 Jul 2021 13:54:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(supervisor):=E6=96=B0=E5=A2=9E=E5=AE=88?= =?UTF-8?q?=E6=8A=A4=E8=BF=9B=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index 1845269..5c73746 100644 --- a/README.md +++ b/README.md @@ -114,3 +114,30 @@ flask init-db ## 服务器部署 +### wsgi +采用 gunicorn ,配置文件请查看 `gunicorn.conf.py` 。暂时未使用 nginx 作为反向代理,需要的可以自行配置。 + +### 守护进程 +使用下面的命令安装Supervisor: +```shell script +$ sudo apt install supervisor +``` + +编辑配置文件 +$ sudo vim /etc/supervisor/conf.d/pear.conf + +写入项目配置 +```shell script +[program:pear] +command=bash /home/ubuntu/pear-admin-flask/start.sh +user=root +autostart=true +autorestart=true +stopasgroup=true +killasgroup=true +``` + +管理项目进程 +```shell script +$ sudo supervisorctl +```