Linux下啟動httpd服務提示not bind to address
這幾天在裝Apache httpd服務後,啟動httpd服務,報錯如下:
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 0.0.0.0 for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:88
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:88
no listening sockets available, shutting down
Unable to open logs [FAILED]
發現是SELinux在作怪,檢視SElinux使用狀態
#getenforce
Enforcing
SElinux未禁用。
1、臨時禁用SELinux:# setenforce 0這樣重啟伺服器之後,還是會啟動SELinux;
備註:setenforce 1 臨時啟用SELinux
2、永久禁用:開啟伺服器上的SELinux配置檔案,預設為:/etc/selinux/config(還有/etc/sysconfig/selinux),內容如下:# This file controls the state of SELinux on the system.# SELINUX= can take one of these three values:# enforcing - SELinux security policy is enforced.# permissive - SELinux prints warnings instead of enforcing.# disabled - SELinux is fully disabled.SELINUX=enforcing# SELINUXTYPE= type of policy in use. Possible values are:# targeted - Only targeted network daemons are protected.# strict - Full SELinux protection.SELINUXTYPE=targeted將上面的SELINUX=enforcing 改為:SELINUX=disable 禁用SeLinux
然後啟動httpd服務:
service httpd start
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 0.0.0.0 for ServerName
[ OK ]
轉載原文:https://blog.csdn.net/rachel_luo/article/details/22311717