ApacheがRestartできない!(98)Address already in use: make_sock…

Apacheが突然死しているようなので再起動してみたら、どうもおかしい。
一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。

[root@www home]# service httpd restart
httpd を停止中: [失敗]
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80
(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
[失敗]

これは通常、ポート80を他のプロセスが使用しているときに出るエラーメッセージ。
どうやらApacheが異常終了したせいで、古いApacheのプロセスが残っているのを、新しいApacheが「80番ポートが使われている!?」と誤解しているらしい。

lsofでhttpのプロセスを調べ、一つずつ強制KILLすると解決する。

[root@www ~]# /usr/sbin/lsof -i | grep http
httpd 7524 apache 3u IPv6 401602 TCP *:http (LISTEN)
httpd 7524 apache 5u IPv6 401607 TCP *:https (LISTEN)

こいつらが80番ポートに居残っているプロセス。

[root@www ~]# kill -9 7464
[root@www ~]# kill -9 7491

キル!キル!

[root@www ~]# service httpd restart
httpd を停止中: [失敗]
httpd を起動中: [ OK ]

全部キルしたらすっきりリスタートできるようになりました。

広告

About: dacelo


9 thoughts on “ApacheがRestartできない!(98)Address already in use: make_sock…”

  1. Pingback: YUUKI
  2. Pingback: 河童星人

Leave a Reply

Your email address will not be published. Required fields are marked *