Apache2を起動した時のエラー

2011.12.18 23:55
Apache2を再起動した際に、
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(ServerNameに127.0.0.1を使用した、FQDN(完全に適切なドメイン名)が確定できません)
というエラーが出る場合があるんですが、これはApacheにサーバー名が定義されていないことが原因です。というのは/etc/hostsファイルで定義したドメインが引けていないというのが原因です。

/etc/hostsファイルに
127.0.0.1               example.com localhost.localdomain localhost

と記載されている場合には、
/etc/apache2/apache2.confの先頭辺りにServerNameの設定をします。
ServerName example.com:80
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
# ...
 これでreloadするとエラーはなくなります。





プロフィール



  • Name :: 山上オサム ♂(39)
  • Hobby :: 武術
  • Work :: Web Designer