執行apachectl start時候,提示以下錯誤:apache
httpd: apr_sockaddr_info_get() failed for shiwei
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerNamedom
緣由:這個問題應該是沒有在 /etc/httpd/conf/httpd.conf 中設定 ServerName。因此apache會用主機上的名稱來取代,首先會去找 /etc/hosts 中有沒有主機的定義。spa
解決辦法:server
(1)能夠設定httpd.conf文件中的 ServerName,以下:ServerName localhost:80 get
(2)在 /etc/hosts 中填入本身的主機名稱 bogon,以下:127.0.0.1 shiwei (用戶名稱)hosts