httpd: apr_sockaddr_info_get() failed for hoteel
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
我在service httpd restart的時候提示上述資訊的。雖然啟動成功了,但是也是很鬱悶的。
這是因為我在配置DNS的時候hostname hoteel造成的。
重新hostname localhost就可以了。
我在網上找來一些有關這方面的資訊,就順便貼在這裡了。
1
在啟動 httpd 時出現
Starting httpd: httpd: apr_sockaddr_info_get() failed for MYHOST
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 所以它會用主機上的名稱來取代,首先會去找 /etc/hosts 中有沒有主機的定義。
所以要解決這個問題可以設定 ServerName 或者在 /etc/hosts 中填入自己的主機名稱 MYHOST,像這樣:
>vi /etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOST
2
在Linux下安裝完Apache 2.2.6,啟動HTTP服務就報錯,似乎不影響服務的使用,但是也挺彆扭的。
[root@linux http]# ./apachectl start
httpd: apr_sockaddr_info_get() failed for linux(在BSD上是apr_sockaddr_info_get() failed for freebsdla)
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
經分析發現是apache的conf目錄下的設定檔httpd.conf中關於hostname設定和/etc/sysconfig/network中的HOSTNAME設定不統一導致的,修改成統一的主機名稱即可解決該問題。
註:/etc/sysconfig/network 預設主控件名是:HOSTNAME=localhost.localdomain