Starting httpd: (98)Address already in use: make_sock: could not bind to address hatası ve çözümü

Apache web sunucunuza restart atmaya çalıştığınızda bazen aşağıdaki hatayı alabilirsiniz:

[root@server ~]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting 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

Problemin çözümü için SSH’tan aşağıdaki komutları uygulayabilirsiniz:

for i in `ps auwx | grep -i nobody | awk {'print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done
for i in `lsof -i :80 | grep http | awk {' print $2'}`; do kill -9 $i; done
service httpd restart