pengdott 2023-08-14 16:08 采纳率: 100%
浏览 6
已结题

安装并配置webvirtmgr+supervisor后,WEB页面无法访问

现象:配置webvirtmgr+supervisor安装配置完成后,页面无法访问:

img

查看supervisor日志,发现如下内容看上去有问题:
2023-08-14 15:19:21,069 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.
2023-08-14 15:19:21,069 INFO Included extra file "/etc/supervisord.d/webvirtmgr.ini" during parsing
2023-08-14 15:19:21,087 INFO RPC interface 'supervisor' initialized
2023-08-14 15:19:21,088 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2023-08-14 15:19:21,088 INFO daemonizing the supervisord process
2023-08-14 15:19:21,089 INFO supervisord started with pid 19302
2023-08-14 15:19:22,092 INFO spawned: 'webvirtmgr-console' with pid 19304
2023-08-14 15:19:22,094 INFO spawned: 'webvirtmgr' with pid 19305
2023-08-14 15:19:23,483 INFO success: webvirtmgr-console entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2023-08-14 15:19:23,484 INFO success: webvirtmgr entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

但是我的配置文件webvirtmgr.ini属主是root,并且也配置了user=root的内容,如下所示:

[program:webvirtmgr]
command=/usr/bin/python /data/webvirtmgr/manage.py run_gunicorn -c /data/webvirtmgr/conf/gunicorn.conf.py
directory=/data/webvirtmgr
autostart=true
autorestart=true
logfile=/var/log/supervisor/webvirtmgr.log
log_stderr=true
user=root
#user=nginx
 
[program:webvirtmgr-console]
command=/usr/bin/python /data/webvirtmgr/console/webvirtmgr-console
directory=/data/webvirtmgr
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/webvirtmgr-console.log
redirect_stderr=true
user=root
#user=nginx


所以没看出有什么问题,不知道WEB页面无法访问是何原因?请教

  • 写回答

2条回答 默认 最新

  • CSDN-Ada助手 CSDN-AI 官方账号 2023-08-14 18:50
    关注

    【以下回答由 GPT 生成】

    根据提供的日志和配置信息,可以看出supervisor已经成功启动并且运行了webvirtmgr和webvirtmgr-console两个进程。而且配置中也指定了以root用户运行进程。

    问题的可能原因和解决方案如下:

    1. 未配置防火墙规则:首先要确保服务器上的防火墙规则允许对webvirtmgr的访问。可以使用以下命令检查是否存在防火墙规则:
    sudo iptables -L
    

    如果存在防火墙规则,而且没有针对webvirtmgr的允许访问规则,则需要添加以下规则:

    sudo iptables -A INPUT -p tcp --dport 8000 -j ACCEPT
    
    1. 监听IP地址和端口是否正确:确保webvirtmgr正在监听正确的IP地址和端口。可以使用以下命令检查webvirtmgr的监听状态:
    sudo netstat -tuln | grep 8000
    

    如果没有监听IP地址和端口,则可能需要修改webvirtmgr的配置文件,以确保监听正确的IP地址和端口。 3. 服务未启动或未正确启动:确保webvirtmgr服务已经启动,并且没有发生错误。可以使用以下命令检查服务状态:

    sudo supervisorctl status
    

    如果服务未启动或者启动失败,可以尝试重启服务:

    sudo supervisorctl restart webvirtmgr
    sudo supervisorctl restart webvirtmgr-console
    
    1. 日志文件没有写入权限:确认日志文件目录是否有足够的写入权限,以及日志文件是否已经创建。可以使用以下命令检查日志文件的权限和存在情况:
    ls -l /var/log/supervisor/webvirtmgr.log
    ls -l /var/log/supervisor/webvirtmgr-console.log
    

    如果没有写入权限或者文件不存在,则需要修改文件权限或者手动创建日志文件:

    sudo touch /var/log/supervisor/webvirtmgr.log
    sudo touch /var/log/supervisor/webvirtmgr-console.log
    sudo chown root:root /var/log/supervisor/webvirtmgr.log
    sudo chown root:root /var/log/supervisor/webvirtmgr-console.log
    

    如果以上步骤都没有解决问题,可能是其他原因导致无法通过WEB页面访问。这需要根据具体情况进一步排查和调试。


    如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 9月7日
  • 已采纳回答 8月30日
  • 修改了问题 8月14日
  • 创建了问题 8月14日

悬赏问题

  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值