Apache HTTPD Address Already In Use: Make_Sock: Could Not Bind to Address 80 / 443 Error

»»»Apache HTTPD Address Already In Use: Make_Sock: Could Not Bind to Address 80 / 443 Error

When starting or restarting Apache HTTPD server which was previously working properly, error occurred and the Apache HTTPD service could not be started. One of the following error message or similar message is displayed and recorded in error log:

Starting httpd/ web server apache2 : (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
[FAILED] / Action ‘start’ failed

The error can happen on port 443 too, where you will see a line of message like the following:

(98)Address already in use: make_sock: could not bind to address [::]:443

The error normally happens after Apache HTTPD web server service crashed but does not exited or terminated cleanly, leaving some remnant processes running, using and occupying ports or other system resources such as port 80 and port 443 (for SSL / HTTPS websites) that are critical for Apache service to launch anew successfully.

Use one of the following commands to determine if port 80 or port 443 is indeed been used by orphaned Apache or any other services:

netstat -anp --tcp --udp | grep LISTEN

Above command lists out all processes running and listening on port 80 and 443

fuser -v 80/tcp
fuser -v 443/tcp

Above commands list out the process IDs and commands which is running on port 80 or port 443.

As the processes are already orphaned, attempt to exit the processes by stopping the Apache HTTPD service no longer work, as system has assumed Apache HTTPD service stopped.

To resolve the issue, kill the remnant processes that are occupying the critical port 80 and/or 443 with the following command:

kill -9 <process ID>

Alternatively, run the following command:

fuser -k -n tcp 80

Replace the port number with 443 if you’re encountering the error on SSL port.

Once all processes hogging with Apache HTTPD web server’s ports are killed and terminated, you can start Apache HTTPD service successfully.

By |2018-05-06T00:03:25+00:00May 6th, 2018|Categories: Web Servers|Tags: |2 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.

STAY IN TOUCH

close-link