-
部署supervisor服務
# easy_install的方式 yum install -y python-setuptools easy_install supervisor echo_supervisord_conf >/etc/supervisord.conf
-
配置supervisord.conf
# 修改supervisord.conf行尾 [include] files = /etc/supervisor/*.conf # web界面顯示 [inet_http_server] port=IP:9001 # 啟動 supervisord -c supervisord.conf # 創建目錄 mkdir -p /etc/supervisor
-
配置nginx.conf文件
# vim /etc/supervisor/nginx.conf [program: nginx] command=/data/nginx/sbin/nginx -g 'daemon off;' # 修改自己的路徑 autorestart=true ; autostart=true ; stderr_logfile=/var/log/error.log ; stdout_logfile=/var/log/stdout.log ; environment=ASPNETCORE_ENVIRONMENT=Production ; user=root ; stopsignal=INT startsecs=10 ; startretries=5 ; stopasgroup=true # 重新加載 supervisorctl -c supervisord.conf reload # 使用supervisorctl啟動nginx服務 supervisorctl start nginx #查看狀態 supervisorctl status