吉林市网站建设_网站建设公司_MongoDB_seo优化
2026/1/22 18:10:40 网站建设 项目流程

问题描述


基于debian11 系统的 supervisor 工具安装使用记录。后续会根据使用情况持续更新。

正文


安装配置

# 安装supervisor
sudo apt update
sudo apt install supervisor

安装完成后,使用 systemctl status supervisor.service 查看服务启动状态

● supervisor.service - Supervisor process control system for UNIXLoaded: loaded (/lib/systemd/system/supervisor.service; enabled; vendor preset: enabled)Active: active (running) since Thu 2026-01-22 17:50:55 CST; 7min agoDocs: http://supervisord.orgMain PID: 101695 (supervisord)Tasks: 1 (limit: 18874)Memory: 16.8MCPU: 401msCGroup: /system.slice/supervisor.service└─101695 /usr/bin/python3 /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf1月 22 17:50:55 brian systemd[1]: Started Supervisor process control system for UNIX.
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,480 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  >
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,480 WARN No file matches via include "/etc/supervisor/conf.d/*.conf"
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,490 INFO RPC interface 'supervisor' initialized
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,490 INFO RPC interface 'supervisor' initialized
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,490 CRIT Server 'unix_http_server' running without any HTTP authentication checking
1月 22 17:50:55 brian supervisord[101695]: 2026-01-22 17:50:55,491 INFO supervisord started with pid 101695

可以看到 supervisor 服务已经正常启动,启动时使用配置文件:/etc/supervisor/supervisord.conf

接下来,配置supervisor网页访问和管理

cd /etc/supervisor/
cp supervisord.conf supervisord.conf.org

编辑 supervisord.conf,在原有基础上添加 [inet_http_server],放在 [supervisord] 之前

; supervisor config file[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)[inet_http_server]
port=0.0.0.0:9001        ; 仅本机访问(最安全),如需内网访问改为 0.0.0.0:9001
username=你的用户名        ; 访问认证用户名(必填,避免无密码访问)
password=你的密码   ; 建议设置复杂密码(可加密,见下文)[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

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询