Apache will not start: could not bind to address [::]:80
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80Short answer
Apache asked the system for port 80 and the system said it is taken. Either another program already listens there, often a second Apache, or two Listen lines in your config overlap. Find the owner of the port with lsof, stop it or move Apache to another port, then run apachectl configtest and start again.
Fix it fast
1Find out which cause you have
Ask the system who owns port 80 right now. If nothing is listed, the problem is in the Listen lines.
sudo lsof -i:802Match what you see, then jump to its fix
- 1
lsof lists a process (httpd, nginx or a dev server) in LISTEN state on port 80Another web server or a second Apache already uses port 80Fix - 2
lsof shows nothing on port 80, but the config has more than one Listen for the same portTwo Listen directives overlapFix - 3
The error appears right after a stop, and a second start a few seconds later worksApache was stopped and started again too fastFix - 4
The error mentions a permission problem with ports under 1024 instead of a busy portApache is not started as root and the port is below 1024Fix
- 1
What does the error look like?
(48)Address already in use: AH00072: make_sock: could not bind to address [::]:80(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Cause 1 of 4
Another web server or a second Apache already uses port 80
1Check
The Apache wiki's first cause is that the address is taken, including by another httpd. On Mac OS X it names lsof and netstat to find the process.
sudo lsof -i:80
netstat -Wan | grep 802Fix
Stop that program, or change the port Apache uses. If Apache itself is the listener, stop it with apachectl before you start it again.
sudo apachectl stop
# or change the port in httpd.conf
Listen 80803Verify
Check the config, start Apache and confirm it is listening.
apachectl configtest
sudo apachectl start
sudo lsof -i:80Confirmed by cwiki.apache.org
Cause 2 of 4
Two Listen directives overlap
1Check
Overlapping Listen directives are a fatal error. A wildcard such as Listen 80 binds the port on every address, so a second Listen 127.0.0.1:80 conflicts with it. Included files count too.
grep -rn "^Listen" /etc/apache2/ /usr/local/etc/httpd/ 2>/dev/null2Fix
Keep one Listen per port. Use either the bare port or the specific address, not both.
# keep one of these, not both
Listen 80
# Listen 127.0.0.1:803Verify
Stop and then start Apache; the docs say Listen changes need a full stop and start, not a restart.
apachectl configtest
sudo apachectl stop
sudo apachectl startConfirmed by httpd.apache.org
Cause 3 of 4
Apache was stopped and started again too fast
1Check
The Apache wiki lists a rapid stop and start as a cause. The old process may still hold the socket for a moment.
sudo lsof -i:802Fix
Use apachectl restart, or wait a few seconds between the stop and the start.
sudo apachectl restart3Verify
Apache stays up and answers on port 80.
curl -I http://localhostConfirmed by cwiki.apache.org
Cause 4 of 4
Apache is not started as root and the port is below 1024
1Check
On Unix-based systems, non-root users cannot bind ports below 1024. The wiki's fix is to start Apache as root.
id -u2Fix
Start Apache with sudo, or use a port above 1023 for development.
sudo apachectl start3Verify
Apache starts and lsof shows httpd on the port.
sudo lsof -i:80Confirmed by cwiki.apache.org
How do I stop it coming back?
- Run only one local web server on port 80, and switch the others to 8080 or another free port.
- Always run apachectl configtest before starting or restarting.
- Keep Listen in one config file only, and avoid repeating it in included files.
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.
Related fixes
Servers
Status code 460 on an AWS Application Load Balancer
elb_status_code 460 in ALB access logs
A 460 is generated by the load balancer, not by your app.
3 causes, each with a fixServers
Application Load Balancer returns 504 for requests to EC2 instances
HTTPCode_ELB_504_Count
A 504 from an Application Load Balancer means it could not get an answer from a target in time.
4 causes, each with a fixServers
apk cannot find py-pip in an Alpine Docker image
py-pip (no such package):
On current Alpine releases there is no package called py-pip.
2 causes, each with a fixServers
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 fixServers
ng serve runs in the container but localhost:4200 does not open
The browser cannot open localhost:4200 although ng serve is running in the container
ng serve listens on localhost by default, which inside a container is the container itself.
3 causes, each with a fixServers
Angular routes return 404 from nginx when you refresh or open a link
The home page loads, but refreshing /some/route shows an nginx 404
Angular routes like /users/42 are not files, so nginx looks for them on disk and returns 404.
3 causes, each with a fix