Apacheを再起動した時に「Could not reliably determine~」というエラーメッセージが出る時の対処法

Apacheを再起動した時に「Could not reliably determine~」というエラーメッセージが出る時の対処法

Apacheを再起動した時に「Could not reliably determine~」というエラーメッセージが出る時の対処法

さくらのVPSでApacheを再起動する際に、いつしか以下のようなメッセージが出るようになりました。

Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName

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

「サーバーの完全修飾ドメイン名(FQDN)が特定できない」といった内容のようですが、Apacheの起動自体には影響ないみたいでちゃんと起動してきます。

とはいえ、エラーらしきメッセージが出るのは気持ち悪いので、対処してみました。

スポンサードリンク

httpd.confにドメインを追加

以下のコマンドを実行して、httpd.confを開きます。

vi /etc/httpd/conf/httpd.conf

/ServerNameで検索して、以下のような記述を探します。そして、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 yourdomain.com:80

当ブログの場合、こんな感じ↓

Apacheの設定追加

これで、もう一度Apacheを再起動すると、メッセージは出なくなりました。

あとがき

無事エラー?メッセージは出なくなりましたが、果たしてこの対処が正しいのか自信がありません。もし間違っていたら指摘していただけると幸いです<m(__)m>

この記事が気に入ったら
いいね!してね♪

Twitter で
スポンサードリンク

関連記事

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です