linux-虚拟机重置http监听端口并安装http失败

在Linux虚拟机中,为了集群安全尝试将HTTP监听端口从80改为8010,但遇到selinux相关错误导致httpd服务无法启动。错误包括缺少libselinux-python和bind失败。解决方案包括安装libselinux-python,检查selinux下HTTP端口,并使用semanage添加8010端口到selinux策略,最终成功启动httpd服务。
摘要由CSDN通过智能技术生成

http的监听端口为80,为了集群安全,修改http的监听端口。修改http.conf中的监听端口为8010,启动报错。

1.“msg”:”Aborting, target uses selinux but python bindings (libselinux-python) aren’t installed!”

解决办法:

[root@lisery01 cm]# yum install  libselinux-python

2.继续执行仍然报错:”msg”: “Unable to start service httpd: Job for httpd.service failed because the control process exited with error code. See \”systemctl status httpd.service\” and \”journalctl -xe\” for details.\n”

查看http的状态:

[root@lisery01 cm]# service httpd status
Redirecting to /bin/systemctl status  ntpd.service
Unit ntpd.service could not be found.
[root@lisery01 cm]# systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 二 2018-05-08 14:35:57 CST; 2min 20s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 10371 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 10370 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 10370 (code=exited, status=1/FAILURE)

5月 08 14:35:57 lisery01 httpd[10370]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:8010
5月 08 14:35:57 lisery01 httpd[10370]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:8010
5月 08 14:
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值