Apacheが起動しないと思ったら... (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
技術系です
結論:Apacheの再起動ができないと思ったら、Listenを2回していたという話
windows アップデートで、開発環境がぶっとんだので、再構築中のことでした
apache 入れて、php 入れて、mysql 入れて、python 入れて、
動作確認OK
バーチャルホスト設定をしていたところ、
Apache再起動時に以下のようなエラー
[root@localhost httpd]# systemctl restart httpd.service Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
いわれた通りに、'systemctl status httpd.service' を実行
Jun 18 04:31:42 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... Jun 18 04:31:42 localhost.localdomain httpd[4077]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 Jun 18 04:31:42 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE Jun 18 04:31:42 localhost.localdomain kill[4079]: kill: cannot find process "" Jun 18 04:31:42 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 Jun 18 04:31:42 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server. Jun 18 04:31:42 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
どうやら、「80ポートが使われている」らしい。
ポートをチェックします
[root@localhost httpd]# netstat -lnp | grep :80 [root@localhost httpd]#
・・・・ない
lsofコマンドで、古いプロセスがないか確認
[root@localhost httpd]# sudo lsof -i | grep http [root@localhost httpd]#
・・・・ない
プロセスがない、でも「既に使われています」
ということは、1回の起動で2回ロードしようとしていないか疑う
[root@localhost httpd]# cat /etc/httpd/conf/httpd.conf | grep "Listen" # Listen: Allows you to bind Apache to specific IP addresses and/or # Change this to Listen on specific IP addresses as shown below to #Listen 12.34.56.78:80 Listen 80 Listen 80
いました。 Listen 80 が2個
昔の httpd.conf からコピペした際に、余分に入っちゃった系
1行消して解決しました。