今天在家裏的RHLE5.5上安裝apache的時候,先用user1用戶./configure命令配置,然後才用root用戶make && make install,結果apache起來的時候就報如下錯誤:
httpd: apr_sockaddr_info_get() failed for bogon
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
雖然不妨礙使用,可是看着錯誤總覺得彆扭,經過查找發現,這個問題應該是沒有在 /etc/httpd/conf/httpd.conf 中設定 ServerName。所以apache會用主機上的名稱來取代,首先會去找 /etc/hosts 中有沒有主機的定義。
所以要解決這個問題可以設定httpd.conf文件中的 ServerName,如下:
(1) ServerName localhost:80
或者在 /etc/hosts 中填入自己的主機名稱 bogon,如下:
(2)127.0.0.1 bogon
原文出自:http://kingphp.blog.163.com/blog/static/20042324420123943624529/