下载安装python

yum install python-setuptools

从官网下载supervisor包

https://pypi.python.org/pypi/supervisor

解压
tar zxf supervisor-3.1.3.tar.gz

 cd supervisor
 

编译

python setup.py install

/usr/bin/echo_supervisord_conf > /etc/supervisord.conf

将命令改为superctl

Vim /home/xiaohe/superctl 
#!/bin/bash
 /usr/bin/python /usr/bin/supervisorctl -c /etc/supervisord.conf $1 $2

修改配置文件,加入nginx

Vim /etc/supervisord.conf
[program:nginx]
command=/home/xiaohe/nginx/sbin/nginx -c /home/xiaohe/nginx/conf/nginx.conf
diretory=/home/xiaohe/nginx
user=root

启动

/usr/bin/supervisord -c /etc/supervisord.conf 

加载

/home/xiaohe/superctl update

查看状态

/home/xiaohe/superctl status

转载于:https://www.cnblogs.com/boy215/p/6274771.html

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐