作者:Chancel, 更新:2019 Mar 15, 字数:3220, 已阅:806
Windows Subsystem for Linux(简称WSL)是一个为在Windows 10上能够原生运行Linux二进制可执行文件(ELF格式)的兼容层,即Windows10的子系统Linux。
WSL系统是个残缺版的Linux,在这里记录一下如何在WSL(Ubuntu16.04)版本下安装supervisor并配置Web界面。
查看版本
chancel@chancel-cp:/mnt/c/Users/ycs10$ lsb_release -c
Codename: xenial
更改软件源
根据查看版本返回的Codename替换掉下面列表中的xenial
deb http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main multiverse restricted universe deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main multiverse restricted universe ```
安装Python2.7
sudo apt-get install python python-pip
安装Supervisor
sudo pip install supervisor
编辑Supervisor文件
sudo vim /etc/supervisord/supervisord.conf
配置参考
; supervisor config file
[inet_http_server]
port = 127.0.0.1:9001
username = your_user
password = your_passwd
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf
启动supervisor
sudo supervisord -c /etc/supervisord/supervisord.conf