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

Posted February 10, 2015 267.5k 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/ (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”
    <Directory “/var/www/html/blaaaa”>
    allow from all
    Options +Indexes

    <VirtualHost *:80>
    DocumentRoot “/var/www/html/Moooo”
    <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>
    DocumentRoot /var/www/

    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

  • Show 2 more comments

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
12 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.

    • Excellent! I searched for the error code on Google, and this page showed up. I used what arnoldkarani said and the code you posted (“sudo systemctl stop nginx”) and it works!
      Thanks arnoldkarani and JianAtNIH!! You both are awesome!

  • Worked like a charm, thanks!

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

  • Excellent! I searched for the error code on Google, and this page showed up. I used what you said and the code JianAtNIH posted (“sudo systemctl stop nginx”) and it works!
    Thanks arnoldkarani and JianAtNIH!! You both are awesome!

  • I had the same issue on Ubuntu 18.04. I followed these steps, but I had to do a couple of additional steps.

    1. nginx still had listeners on :80
    2. Ran “sudo netstat -ltnp | grep :80”
    3. Returned a process id for nginx
    4. “sudo kill -9 [proccess id]”

    I had to run steps 2 through 4 above an additional time to stop the nginx: worker from listening as well.

    • @mlutz2011 In 2021, after scouring umpteen forums and even raising a ticket with Bitnami, I finally figured out the problem that I had been busting my head on since the last 3 days. Thank you for this! Just so that someone else in my situation might find it helpful, here’s my Problem/Solution:

      Environment: Debian 10 (buster) with Apache2 (NOT NGINX)
      Use case: Wordpress VM on Google Cloud - trying to install SSL
      First attempt: Using Certbot which requires installing snapd (SUXXX!!!)

      $ sudo apt update
      $ sudo apt install snapd
      $ sudo snap install core; sudo snap refresh core
      $ sudo snap install --classic certbot
      $ sudo ln -s /snap/bin/certbot /usr/bin/certbot
      $ sudo certbot --apache

      At this point I got my first error:
      “Unable to restart apache using [‘apache2ctl’, 'graceful’]
      Cleaning up challenges”

      Tried removing any old defunct certbot installs if any) using:

      $ sudo apt remove --auto-remove python-certbot-apache

      None were present (how dumb of me):
      “0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.”

      Second attempt: Using Lego (Worked but messed up my system)

      $ sudo apt-get install lego 
      $ lego -d -d -a -m -k rsa2048 --http --pem run

      looked good so far…
      But darn it I forget to stop the scripts before installing the certificates, so:

      $ sudo /opt/bitnami/ stop

      But the website had no SSL certificate showing up still
      So I Started, checked Status & then Stopped the scripts a couple of times:

      $ sudo /opt/bitnami/ start
      $ sudo /opt/bitnami/ status
      $ sudo /opt/bitnami/ stop
      $ sudo /opt/bitnami/ start
      $ sudo /opt/bitnami/ status
      $ sudo /opt/bitnami/ stop

      Got the following error:
      “/opt/bitnami/mysql/scripts/ : mysql started at port 3306
      /opt/bitnami/php/scripts/ : php-fpm started
      Syntax OK
      (98)Address already in use: AH00072: makesock: could not bind to address [::]:80
      (98)Address already in use: AH00072: make
      sock: could not bind to address
      no listening sockets available, shutting down
      AH00015: Unable to open logs
      /opt/bitnami/apache2/scripts/ : httpd could not be started”

      That’s where I started searching the net for answers and after 2 days found you. When I did:

      $ sudo netstat -ltnp | grep :80

      I got:
      tcp6 0 0 :::80 :::* LISTEN 6961/apache2
      Which was weird since Apache2 shouldn’t be running. So I killed the process using: sudo kill -9 6961
      Again I ran::

      $ sudo netstat -ltnp | grep :80

      I got:
      tcp6 0 0 :::80 :::* LISTEN 7448/apache2
      Which was weird since Apache2 shouldn’t be running. So I killed the process again and a third time after that. Finally, on the 4th try it didnt come back with any results. So then I ran:

      $ sudo /opt/bitnami/ start

      And finall:
      “/opt/bitnami/mysql/scripts/ : mysql (pid 8366) already running
      /opt/bitnami/php/scripts/ : php-fpm (pid 8424) already running
      Syntax OK
      /opt/bitnami/apache2/scripts/ : httpd started at port 80”

      Worked :)
      Thanks a million :-x

  • This happened out of the blue to a client’s server a few days ago - this fix solved it! I too was wondering why on earth nginx was on my client’s LAMP setup.

  • Fixed it for me. Thanks.

  • That you very much for this solution to my problem.

  • This also solved the issue for me (nginx running was the problem. Stop it an Apache2 restarts no problem). Thanks Thanks Thanks!!!

  • It’s almost 2021, 5 years later. This is still the solution to that problem. Installed Vesta, rebooted, couldn’t get Apache up.

    Removed nginx, things started working.

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.

After having worked on this for two hours my final solution, which I think is what actually worked. Is that instead of doing
sudo apachectl -k restart
(Which is what made the message appear for me). I finally did

sudo apachectl stop
waiting for my site which showed “It works!” to go down.
sudo apachectl start

So this is just the stupidest solution but it worked for me. Though when I woke up this morning my entire php@7.2 folder was missing (something with the latest brew update perhaps?). So I checked my /usr/local/etc/httpd/httpd.conf file, then found a whole new httpd.conf file in the /etc/apache2/ folder, so I just copied my original httpd.conf file over that one.
Don’t know which folder apachectl checks but at least it works now.

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.

Previous 1 2 Next