Apache 「httpd: Could not reliably determine the server’s fully qualified domain name」のエラー

Apache を再起動すると、ログに下記のように「httpd: Could not reliably determine the server’s fully qualified domain name」のエラーが表示されました

Jan  6 04:02:02 www01 httpd: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using xxx.xxx.xxx.xxx Set the 'ServerName' directive globally to suppress this message

エラーの原因ですが、「httpd.conf」にて「ServerName」の設定がされていないのが原因の可能性が高いので「ServerName」を設定すればエラーが解消されます。

ServerName の箇所は「#ServerName www.example.com:80」とコメントアウトされているので、コメントアウトを外してドメイン名、ホスト名、IPアドレス等を設定します

$ sudo vim /etc/httpd/conf/httpd.conf
#ServerName www.example.com:80

# コメントアウトを外して、使用するドメインを設定
ServerName example.com:80

# ドメインを使用しない場合はIPアドレスを設定
ServerName 192.168.0.10:80

設定変更したら、Apacheを再起動して設定を読み直してエラーがないかを確認します

$ sudo systemctl restart httpd

 

 

スポンサーリンク

0
0

LinuxApache,CentOS 7,CentOS 8

Posted by admin