(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 - error

February 10, 2015 132.4k views


Being a novice on configuring Apache servers I managed to get my droplet up and running and have two domains pointing to it.
Made my own virtual host files using the given tutorials, DNS all figured out...great! It worked all just fine.

But now I cannot reach my two domain anymore and when I restart Apache using terminal (sudo service apache2 restart) I get this error:

  • Restarting web server apache2 AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/huizenmeteenverhaal.nl.conf:5 (98)Address already in use: AH00072: makesock: could not bind to address [::]:80 (98)Address already in use: AH00072: makesock: could not bind to address [::]:80

I googled a fair bit but got lost in all these different solutions that make my novice head spin.

Any help on this...?

Just can't get my head around the fact that it was al working just fine, and just stopped.

  • Ok, actually got it back working by changing the .conf files in /sites-available and /sites-enabled to .config and back to .conf again. (WHY? HOW?)

    Really don't get that either....
    If somebody is able to shed some light it would be highly appreciated.

    Thank you.

  • By using :: you are listening to a IPv6 Loopback?

    Anyway.. In your virtualhost, Use * and not the IP.
    Also, .conf is default for apache, so keep your stuff as .conf and not .config.

    Also at the top, listen by port and not ip and port.. use *:80 / *:443 in your Vhosts.


    Listen 80

    <VirtualHost *:80>
    DocumentRoot "/var/www/html/blaaaa"
    ServerName blaaaa.com
    <Directory "/var/www/html/blaaaa">
    allow from all
    Options +Indexes

    <VirtualHost *:80>
    DocumentRoot "/var/www/html/Moooo"
    ServerName Moooo.com
    <Directory "/var/www/html/Moooo">
    allow from all
    Options +Indexes

  • OK,

    So it was all working just fine...and it stopped again.

    As far as I can tell my .conf file is correct:

    Ensure that Apache listens on port 80

    Listen 80

    Listen for virtual host requests on all IP addresses

    NameVirtualHost *:80

    <VirtualHost *:80>
    ServerAdmin me@mywebsite.com
    ServerName huizenmetkarakter.nl
    ServerAlias www.huizenmetkarakter.nl
    DocumentRoot /var/www/huizenmetkarakter.nl

    Correct me if I'm wrong.

    Then if I try to run the : service apache2 reload command it tells me apache is not running.

    I really can't see what is going wrong here. I was working on my sites and not even fiddling my .conf-files or whatever. It just stopped working....

    Please advice...

    Kind regards,


  • Hi Jasper,

    Did you get this resolved? I'm experiencing it now and haven't found a solution.


  • Hi,
    on my server when i restart the apache it gives error.
    sudo service apache2 restart

    • Restarting web server apache2 (98)Address already in use: AH00072: makesock: could not bind to address [::]:80 (98)Address already in use: AH00072: makesock: could not bind to address no listening sockets available, shutting down AH00015: Unable to open logs Action 'start' failed. The Apache error log may have more information. ...fail!

    Please reply me ASAP
    Thanks in advance

  • I had the same issue because I had a process of apache waiting for the passphrase for ssl.
    Check your running commands for apache with any top program.

10 Answers

This could be brought about by Nginx, if you have it install run these two command to uninstall it. Use commands(1 or 2) and 3

  1. sudo apt-get remove nginx nginx-common # Removes all but config files.

  2. sudo apt-get purge nginx nginx-common # Removes everything.

  3. sudo apt-get autoremove #After using any of the above commands, use this in order to remove dependencies used by nginx which are no longer required.

  • This was the solution to my problem. I was wondering why I had ngix while my websites were supposed to work on apache2. Thanks!

  • You are a wonderful human being, thank you for this. I started down the nginx path initially, but realized I had no idea what I was doing since I've used Apache for years. I should've assumed that they'd create some issue in the future, but completely forgot to remove it. You're lifesaver!

  • I just signed up to tell how how grateful I am to you.
    I tried shutting down nginx but it didn't work.. After having scraped nearly all of askubuntu, i found just what i needed :) Thanks!

  • Thank you!
    I got 404 on PhpMyAdmin. Trying to restart apache2 but get same error. That was a tricky to figure out that «Welcome to nginx!» message on my sites is completely nonsense, because I use apache2. Wonder how i got nginx.

  • Thanks! Nginx is the cause in my case. After I stopped Nginx ("sudo systemctl stop nginx"), apache server is working fine.

  • Worked like a charm, thanks!

  • Almost 2 years later and this post is still helping, I tip my hat to you sir! Thank you

I am running FreeBSD (Linux like...) without NGINX and had this same problem. It appears that there was a httpd process that was hung. Apparently, this happens every so often. I listed all processes and grep out the httpd process to see what was hung. If you do not manually kill the process, it should timeout eventually. The eventual timeout is probably why the problem fixed itself in some of the previous comments. In my situation, I went ahead and manually killed the process and then started apache. Here's the commands:

== Notice the commands might vary slightly for Linux ==

= Show processes hung =
ps wax | grep httpd

= Kill Process ID 1234 =
kill 1234

= Start Apache24 =
apachectl start

= Verify it is running =
service apache24 status


I hope this helps.

I also have the same problem too on my Ubuntu 14.04.
After fresh install everything was normal until I want to change default port on ports.conf to 8080 (and VirtualHost on sites-enabled/000-default.conf) but failed. I changed it all back to port 80.
Restart apache2 and failed :(

Problem is solved by comment line: Listen 80 on ports.conf, and add this "Listen 80" to end of file /etc/apache2/apache2.conf. And restart apache2.

Hope it helps.


I tried to restore to default setting (move Listen 80 back to ports.conf) and it runs normally again.
It's really strange :(

I have the same issue on my brand-new Ubuntu droplet and nothing above seems to work.

I added Listen 80 to ports.conf and still was unable to start Apache.

I have the same issues, so please put the following on ports.conf
NameVirtualHost *:80
NameVirtualHost *:443

A few people seem to be having this problem. The error message says, in part,: "Address already in use", so I guess you're getting the error because of the duplication, i.e., when you have both 'Listen x.x.x.x:80' and 'Listen 80' at the head of your conf file. All you really need is: 'Listen 80'. I hope this helps.

I recently had the same problem and found some answers here.

The fact that port 80 could be busy with something else sounded strange. I checked port 80 and noticed that a to me unknown process occupied it. I killed it and apache2 could then be run normally.

If there is nothing wrong with your files, check what process could block access to the relevant port.

I had this problem today after resizing my droplet. No idea what causes it but when it went up came with Nginx. Crazy stuff.

So I had to stop there (sudo service nginx stop) and start Apache (sudo service apache2 start)

And works perfectly.

For me it was NextCloud causing the issue.
I installed it using snap so to remove i just did:

sudo snap remove nextcloud

And apache started right up.

Thanks for all the suggestions!

Also, you can see what processes are using the port by doing:

sudo netstat -peanut | grep ":80"

That may give you a better idea of what's causing the problem.

I had the same ssue. The problem is that server is being used by nginx! U have to unistall it first

sudo apt-get remove nginx nginx-common # Removes all but config files.

sudo apt-get purge nginx nginx-common # Removes everything

sudo apt-get autoremove #After using any of the above commands, use this in order to remove
dependencies used by nginx which are no longer required.

Have another answer? Share your knowledge.