一、安装
> wget https://pypi.[Python](http://lib.csdn.net/base/python).org/packages/44/80/d28047d120bfcc8158b4e41127706731ee6a3419c661e0a858fb0e7c4b2d/supervisor-3.3.0.tar.gz # 下载源码包
> tar xvf supervisor-3.3.0 # 解压
> cd supervisor-3.3.0 # 进入目录
> python setup.py install # 安装
成功安装后可以登陆python控制台输入import supervisor 查看是否能成功加载
二、配置
三、常用指令
> supervisord -c /etc/supervisord.conf # 配置文件,守护进程形式启动服务
> supervisorctl shutdown # 关闭服务
> supervisorctl # 打开命令行
> supervisorctl update # 更新配置
> supervisorctl reload # 重启所以程序
> supervisorctl start program_name # 启动某个程序
> supervisorctl restart program_name # 重启某个程序
> supervisorctl stop program_name # 停止某个程序
四、web管理界面配置
;[inet_http_server] ; inet (TCP) server disabled by default
;port=127.0.0.1:9001 ; (ip_address:port specifier, *:port for all iface)
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
修改成:
[inet_http_server] ; inet (TCP) server disabled by default
port=0.0.0.0:9001 ; (ip_address:port specifier, *:port for all iface)
username=user ; (default is no username (open server))
password=123 ; (default is no password (open server))
port:绑定访问IP和端口,这里是绑定的是本地IP和9001端口
username:登录管理后台的用户名
password:登录管理后台的密码