加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

解决SELinux导致Apache更改端口后无法启动的问题

发布时间:2020-12-14 00:12:02 所属栏目:Linux 来源:网络整理
导读:systemctl start httpd? ? # 将Apache的默认端口改为90后,启动Apache时提示失败 systemctl status httpd? ? # 查看Apache的状态 可以看到提示:Permission denied: AH00072: make_sock: could not bind to address [::]:90,意思是说权限被拒绝:AH00072: ma

systemctl start httpd? ? # 将Apache的默认端口改为90后,启动Apache时提示失败

systemctl status httpd? ? # 查看Apache的状态

可以看到提示:Permission denied: AH00072: make_sock: could not bind to address [::]:90,意思是说权限被拒绝:AH00072: make_sock:无法绑定到地址[::]:90

这是 SELinux 安全机制导致的

解决方法:

semanage port -l | grep http? ? ?#?查看现在支持的httpd端口

http_port_t?? tcp? 80,81,443,488,8008,8009,8443,9000

可以看到http_port_t处没有90端口

semanage port -a -t http_port_t -p tcp 90? ? # 将90端口加入SELinux

systemctl restart httpd? ? ?# 重新启动Apache服务器

netstat -ntlp | grep http? ? # 查看端口状态,如下图,说明启动成功

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读