Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Apache will not restart: make_sock could not bind to address [::]:443

ErrorAddress already in use: make_sock: could not bind to address [::]:443

Short answer

Apache could not open port 443 because something already holds it. Often that is Apache's own earlier Listen line: overlapping Listen directives are a fatal error. A restart can also fail when the Listen set changed, so do a full stop and start. Remove the duplicate Listen line first.

  • Applies to Apache httpd 2.4, Ubuntu 24.04
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List every Listen line in the configuration. Two lines that cover port 443 are the usual culprit.

    grep -rn "^\s*Listen" /etc/apache2/
  2. 2Match what you see, then jump to its fix

    1. 1More than one line in the grep output covers port 443 (for example a global Listen 443 and an SSL module file that adds its own)Listen 443 appears more than once, or overlaps another ListenFix
    2. 2The first start worked, the restart after editing Listen failedA restart after changing the Listen setFix

What does the error look like?

  • Address already in use: make_sock: could not bind to address [::]:443

Cause 1 of 2

Listen 443 appears more than once, or overlaps another Listen

1Check

Apache documents that overlapping Listen directives are a fatal error that stops start-up. A plain Listen 443 can occupy the IPv6 wildcard [::]:443, which also covers IPv4 on most systems.

grep -rn "Listen" /etc/apache2/ports.conf /etc/apache2/mods-enabled/

2Fix

Keep one Listen line for the port, or use explicit addresses that do not overlap.

Listen 0.0.0.0:443
Listen 192.0.2.10:80

3Verify

Stop and start Apache, then read the status.

sudo systemctl stop apache2 && sudo systemctl start apache2

Confirmed by httpd.apache.org

Did this fix it?

Cause 2 of 2

A restart after changing the Listen set

1Check

On a restart Apache keeps its original ports open so clients are not refused. If the new Listen set conflicts with the old one (for example 127.0.0.1:80 changed to 80), the configuration fails.

systemctl status apache2 --no-pager

2Fix

Make a full stop followed by a start instead of a restart or reload.

sudo systemctl stop apache2
sudo systemctl start apache2

3Verify

Check the service is active.

systemctl is-active apache2

Confirmed by httpd.apache.org

Did this fix it?

How do I stop it coming back?

  • Keep Listen lines in one file (ports.conf) and nowhere else.
  • After changing Listen, stop and start the service instead of restarting.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Related fixes

Servers

dnf cannot install MySQL on Amazon Linux 2023

dnf cannot find a mysql-server package on Amazon Linux 2023

Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.

3 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.