解决SELinux导致Apache更改端口后无法启动的问题
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? ? # 查看端口狀態,如下圖,說明啟動成功
轉載于:https://www.cnblogs.com/opsprobe/p/11385549.html
總結
以上是生活随笔為你收集整理的解决SELinux导致Apache更改端口后无法启动的问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 修改/etc/sudoers权限后的补救
- 下一篇: ctrNet库介绍