
raspberry piのapache2エラー “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” を解決する
2015/02/15 ysdyt 0 Comments
write 2015/2/15
raspberry piにて service apache2 start を実行すると以下のエラー文が出力される
[….] Restarting web server: apache2apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action ‘start’ failed.
The Apache error log may have more information.
failed!
自分の環境では以下を行うと(とりあえず)解決できた。
/etc/apache2/conf.d/ に移動し
sudo nano httpd.conf を実行(httpd.confファイルはおそらく無いので、ここで新規作成される)
httpd.confファイルの中には下記の一文だけを書き足す
ServerName localhost
これを保存する
参考: Fixing Apache 2 “Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName” Error on Raspberry Pi Wheezy
http://aryo.lecture.ub.ac.id/fixing-apache-2-could-not-reliably-determine-the-servers-fully-qualified-domain-name-using-127-0-1-1-for-servername-error-on-raspberry-pi-wheezy/
これで再度、service apache2 start すると動くらしいのだが、実際にやってみると今度は以下のエラーが出力されてまだ動かない
[….] Restarting web server: apache2(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action ‘start’ failed.
The Apache error log may have more information.
failed!
これの解決は /etc/apache2/ports.conf のファイル中に存在する
NameVirtualHost *:80
Listen *:80
の二行をコメントアウト(もしくは削除)するだけ。
削除後のファイルを保存して service apache2 start してみるとようやく正しく動いた :)
参考: [SOLVED] Apache2 / Unable to start
http://forums.debian.net/viewtopic.php?f=5&t=105457