我在运行Fedora26的linux服务器上安装并configuration了supervisord,并且configuration为在9001端口上运行supervisor web界面。但是,在连接到同一networking的另一台计算机上将linux服务器的IP和端口input到我的浏览器时,得到浏览器错误“无法访问此网站”。 我真的很困惑,为什么发生这种情况。 我跟随主pipe文件,并执行必要的步骤。
这是我的supervisord.conf文件。
[unix_http_server] file=/var/run/supervisor/supervisor.sock ; (the path to the socket file) chmod=0700 ; sockef file mode (default 0700) [inet_http_server] ; inet (TCP) server disabled by default port=*:9001 ; (ip_address:port specifier, *:port for all iface) [supervisord] logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) logfile_backups=10 ; (num of main logfile rotation backups;default 10) loglevel=info ; (log level;default info; others: debug,warn,trace) pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) ; 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/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 = supervisord.d/*.ini
另外,这里是运行tail -f /var/log/supervisor/supervisord.log后的输出。
2017-09-26 12:50:32,569 INFO supervisord started with pid 2671 2017-09-26 13:30:01,848 WARN received SIGTERM indicating exit request 2017-09-26 13:30:02,083 CRIT Supervisor running as root (no user in config file) 2017-09-26 13:30:02,083 WARN No file matches via include "/etc/supervisord.d/*.ini" 2017-09-26 13:30:02,114 INFO RPC interface 'supervisor' initialized 2017-09-26 13:30:02,115 CRIT Server 'inet_http_server' running without any HTTP authentication checking 2017-09-26 13:30:02,115 INFO RPC interface 'supervisor' initialized 2017-09-26 13:30:02,115 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2017-09-26 13:30:02,116 INFO daemonizing the supervisord process 2017-09-26 13:30:02,116 INFO supervisord started with pid 3026
尝试连接到我的浏览器中的networking界面不会生成任何新的日志。
这里是sudo netstat -anp | grep 9001的输出 sudo netstat -anp | grep 9001 。
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN 3026/python2
有没有我错过了一个步骤? 任何帮助是极大的赞赏。
9月28日更新
我运行nmap来查看端口是否启动,这里是输出。
Starting Nmap 7.60 ( https://nmap.org ) at 2017-09-28 10:20 CDT Nmap scan report for caseloader-server (xxxx) Host is up (0.00049s latency). Not shown: 998 filtered ports PORT STATE SERVICE 22/tcp open ssh 9090/tcp open zeus-admin MAC Address: x:x:x:x:x:x (IBM)
所以看起来9001端口不起来。 还运行telnet命令连接到端口9001,这里是输出。
Trying xxxx.. telnet: connect to address xxxx: Connection refused telnet: Unable to connect to remote host
但运行telnet连接到显示打开连接的端口就好了。
港口9090:
Trying xxxx.. Connected to caseloader-server. Escape character is '^]'.
港口22:
Trying xxxx.. Connected to caseloader-server. Escape character is '^]'.
所以看来错误肯定是在服务器端。
好吧,我明白了。 我终于可以连接到我的浏览器的网页界面。 我使用以下命令将端口添加到防火墙: sudo firewall-cmd --permanent --add-port=9001/tcp 。 重新加载防火墙configuration并重新启动Supervisor服务后,我现在可以查看Web界面。 非常感谢你的帮助! 如果将来遇到这个问题,我一定会记住这些故障排除步骤。