Apacheのエラー:Could not reliably determine the server’s fully qualified domain name〜とメッセージが出たときの対応


httpd: Could not reliably determine the server’s fully qualified domain name, using for ServerName



このエラーは、「/etc/sysconfig/network」、 「/etc/hosts」 にlocalhost以外に自分で設定したホスト名が、Apacheの設定ファイルに定義されていないために発生する。

# Do not remove the following line, or various programs
# that require network functionality will fail.               hoge.altqua.com localhost.localdomain localhost

と書いた場合、/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 this is not set to valid DNS name for your host, server-generated
# redirections will not work.  See also the UseCanonicalName directive.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#ServerName www.example.com:80
ServerName hoge.altqua.com:80