yum install supervisor
出现
unix:///var/run/supervisor/supervisor.sock no such file
执行 启动 supervisor 若有错误会有提示
sudo supervisord -c /etc/supervisord.conf
如果是虚拟环境 需要 pip install 各自的 gunicorn 和 gevent !
gunicorn 文档
https://docs.gunicorn.org/en/stable/index.html
示例
[program:test_proj]
directory=/home/test_proj/test_proj
command = /root/.pyenv/versions/test_proj/bin/gunicorn -k gevent -w 1 -b 127.0.0.1:4108 --pythonpath=. --timeout=5 test_proj.wsgi:application
environment=PATH="/root/.pyenv/versions/test_proj/bin:$PATH",TEST_PROJ_ENV=PRODUCT
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/test_proj/info.log
stderr_logfile=/var/log/supervisor/test_proj/info.log
loglevel=info