Apache Address already in use: make_sock: could not bind to port 80 or 443 error and solution

https://‮al.www‬utturi.com
Apache Address already in use: make_sock: could not bind to port 80 or 443 error and solution

The "Address already in use: make_sock: could not bind to port 80 or 443" error in Apache indicates that another process is already using the HTTP or HTTPS port, and Apache is unable to bind to that port. This can happen if another web server, such as Nginx, is already running on the same machine and using the default HTTP or HTTPS port.

To fix this error, you can either stop the other process that is using the HTTP or HTTPS port, or change the port that Apache uses.

To stop the other process, you can use the netstat command to identify the process that is using the HTTP or HTTPS port, and then use the kill command to stop it. For example, to stop the process that is using port 80, you can run the following commands:

# Identify the process that is using port 80
sudo netstat -tulpn | grep :80

# Stop the process using the kill command, replacing PID with the actual process ID
sudo kill -9 PID

After stopping the other process, you can start Apache and it should be able to bind to the HTTP or HTTPS port.

Alternatively, you can change the port that Apache uses by modifying the httpd.conf file, which is typically located in the conf directory of your Apache installation. Locate the Listen directive, and change the port number to a different value. For example, to change the HTTP port from 80 to 8080, you can modify the Listen directive like this:

Listen 8080

After changing the port number, restart Apache for the changes to take effect. This should allow Apache to start without the "Address already in use" error.

Created Time:2017-10-16 14:38:35  Author:lautturi