apache2再起動時にAH00558が発生する

ubuntu 14.04 LTS のapache2を再起動したときに、以下のエラーがでます。

ubuntu@ubuntu:/etc/apache2/conf-available$ sudo service apache2 restart
 * Restarting web server apache2
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[ OK ]

解決方法

Servernameを設定することで、エラーが出なくなりました。

  • ホスト名を確認
$ hostname
ubuntu
  • fqdn.conf にServernameを設定
$ cd /etc/apache2/conf-available/
$ sudo touch fqdn.conf
$ sudo vi fqdn.conf

ServerName ubuntu
  • apache2再起動
$ sudo a2enconf fqdn
$ sudo service apache2 restart

参考

ubuntuにおけるapache2のAH00558エラーを解決する。 - mk_55's diary