LoginSignup
28
19

More than 3 years have passed since last update.

[Docker]AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ***.***.*.*. Set the 'ServerName' directive globally to suppress this message

Last updated at Posted at 2019-03-30
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ***.***.*.*. Set the 'ServerName' directive globally to suppress this message

Dockerで

docker-compose up --build

ってやると必ず出てくるこの警告(私が)。
解決として、https://askubuntu.com/questions/256013/apache-error-could-not-reliably-determine-the-servers-fully-qualified-domain-n
に書いてあることで解決できました。

しかし、このページが英語であること。DockerでないのでDockerの場合の対策方法を書きます。

と言ってもDockerファイルに以下を追記してもらうのみです!

RUN echo "ServerName localhost" | tee /etc/apache2/conf-available/fqdn.conf
RUN a2enconf fqdn

内容はというと、

teeがファイルの書き込みのようなので、
fqdn.confにServerName localhostを書くということみたいです。
書き込みと言っても、もともとないのでファイル作成、書き込みを行う感じですね。

a2enconfはfqdnのファイルを有効にするというものらしい。

なので上記追加でコンテナの中はこんな感じになってます!!

root@056e18a8a70b:/etc/apache2/conf-available# ls
charset.conf  docker-php.conf  fqdn.conf  localized-error-pages.conf  other-vhosts-access-log.conf  security.conf  serve-cgi-bin.conf
root@056e18a8a70b:/etc/apache2/conf-available# cat fqdn.conf
ServerName localhost
root@056e18a8a70b:/etc/apache2/conf-available# 

上記の内容を簡単に説明

現在いるところ(/etc/apache2/conf-available) で フォルダの中のリスト表示(ls)

fqdn.conf が追加されていることが確認できるとで cat で中身確認

ServerName localhostが記述されている

っと言った感じです。

ちなみにこれ、
https://help.ubuntu.com/community/ApacheMySQLPHP#Troubleshooting_Apache
のトラブルシューティングに書いてあるよと言っていますね!

参考
https://askubuntu.com/questions/256013/apache-error-could-not-reliably-determine-the-servers-fully-qualified-domain-n
https://eng-entrance.com/linux-command-tee
http://www.ei.fukui-nct.ac.jp/~t-saitoh/mt/2015/10/debianapache2.html

28
19
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
28
19