解決Apache啟動錯誤:httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName


啟動apache遇到提示:

[root@bqh-119 conf]# ../bin/apachectl -t
httpd: apr_sockaddr_info_get() failed for bqh-119
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
Syntax OK
[root@bqh-119 conf]# ../bin/apachectl graceful
httpd: apr_sockaddr_info_get() failed for bqh-119
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

 

上面httpd:行內容的提示意思是不能確定服務器的FQDN,使用127.0.0.1代替

去掉上面提示的方法為:

輸入命令vim ./conf/httpd.conf +99 回車,進入99行左右增加如下配置,然后從啟apache即可

ServerName 127.0.0.1:80

快速解決方法:

[root@bqh-119 apache]# sed -i 's#\#ServerName www.example.com:80#ServerName 127.0.0.1:80#g' ./conf/httpd.conf
[root@bqh-119 apache]# grep ServerName ./conf/httpd.conf
# ServerName gives the name and port that the server uses to identify itself.
ServerName 127.0.0.1:80

再次重啟就不報提示信息了:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM