Small blog about system administration.

HTTPD restart failed: Address already in use

When you are trying to start Apache Web server, you get the following error in the console and in error_log:

"(98)Address already in use: make_sock: could not bind to address [::]:443 no listening sockets available, shutting down"

(It is also possible that the error discusses the 80 port.)
This error means that some other process already uses 443 (80) port and Apache cannot bind to it.

To fix your problem, just run these 4 commands:  

# 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


No comments :

Post a Comment