[Apache][エラー] httpd: apr_sockaddr_info_get() failed for

Apache をインストールして、起動や configtest すると下記のようなエラーが発生しました。

httpd: apr_sockaddr_info_get() failed for server_name
httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

■ 解決方法

● /etc/hosts に正しくホスト名を設定する

(例) ホスト名が www.codenote.net のとき

127.0.0.1               www.codenote.net localhost.localdomain

● /etc/sysconfig/network の設定変更

HOSTNAME=www.codenote.net

● service network restart を実行する

/etc/sysconfig/network の設定変更後、network 再起動をやり忘れていた場合。
 

● /etc/httpd/conf/httpd.conf の ServerName の設定変更

# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
#ServerName www.example.com:80
ServerName www.codenote.net:80

以上です。
 

【参考】

Apache で apr_sockaddr_info_get() failed for が発生する – foldrrの日記 はてなブックマーク - Apache で apr_sockaddr_info_get() failed for が発生する - foldrrの日記

Apache の httpd: apr_sockaddr_info_get() failed for エラー はてなブックマーク - Apache の httpd: apr_sockaddr_info_get() failed for エラー