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

Q. How do I fix an error, while restarting Apache ~ Address already in use: make_sock: could not bind to port 80?

ADVERTISEMENTS

A. If you are running SELinux disable temporary for port 80.

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

First make sure port 80/443 is not used by any other service or application with netstat command:

# netstat -tulpn| grep :80

If port 80 is bind to httpd, kill all process:
# killall -9 httpd

Now start the httpd:
# /etc/init.d/httpd start

Also make sure you are root while starting the httpd.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallCentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNCentOS 8 Debian 10 Firewall Ubuntu 20.04

ADVERTISEMENTS
35 comments… add one
  • vijay prakash Feb 7, 2007 @ 13:28

    Sir,

    I have already used above commands but still the problem persist. When i use netstat then no pid/program name displays associated with it as below output.

    netstat -tulpn | grep :80

    tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN –

    Please help me in this situation what should i do.

    thankyou.

    vijay

  • bbm4n Nov 24, 2007 @ 22:44

    you must sudo netstat or it won’t show you everything (sudo killall also)

  • Vladimir May 8, 2008 @ 11:12

    Try to killall -9 php – this should solve your problem

  • Active Jul 13, 2008 @ 3:14

    The post has helped us a lot.

  • abbas Sep 19, 2008 @ 7:16

    Is this step are applicable for Ubuntu 7.10? , if trying step no2 killall -9 httpd displaying no process kill however if trying to run step 3 its displying no such file or directory

  • thx Oct 28, 2008 @ 0:04

    Shortest solution to my problem. Thanks!

  • Libran24 Jan 20, 2009 @ 19:51

    Thanks. Worked great !!

  • terminator Aug 18, 2009 @ 0:15

    Thanks heaps, it solves my problem

    But do you know why it causes it? Looks like the apache2 crashes then it didn’t shut down the connection to port 80?

  • Ted Sheckler Aug 18, 2009 @ 23:06

    Some linux builds are configured to include conf.d/ssl.conf which binds to the hosts IP at port 443. This will generate the same error mentioned here.

    I resolved the problem by deleting the VirtualHost block in /etc/conf.d/ssl.conf and commenting out the Listen 443 directive.

    One might run into this if they define their own instance with SSL enabled.

  • ZeroCool Sep 2, 2009 @ 7:59

    Stop iis server from windows service
    (administrator tool -> services – > world wide web)

    And Start Apache

    • The Plague Apr 15, 2012 @ 23:22

      Really? Really? Windows server? More like an oxymoron. Have fun playing as a “point ‘n’ click” admin wannabe, you little n00blet.

  • Flyboy Nov 12, 2009 @ 20:10

    Ok. I had the same issue. I was running Apache2 so after running the:

    sudo netstat -tulpn| grep :80

    I saw that apache2 was listening to that port. I shut all apache2 services down by doing the following:

    sudo killall -9 apache2

    Then ran:
    netstat -tulpn| grep :80
    to see if there was anything left open. If no results, the process was killed.

    Then start up your apache2 services using:

    sudo /etc/init.d/apache2 start

    This resolved my problems! Hope this helps others. What a freakin pain!!!!!

    • Igor Dec 20, 2011 @ 9:03

      @Flyboy, thanks a lot, was helpful for me.

  • oucil Feb 18, 2010 @ 18:45

    Saved me @$$, tanks!

  • Viet Ngo May 2, 2010 @ 15:17

    Thanks for the comment to take out ssl :443. That’s what been stopping my restarting httpd.

  • Jack Read Nov 10, 2010 @ 16:11

    Yes! Thanks for your post… you saved me :-)

  • artur Nov 18, 2010 @ 18:11

    it does’t help me…^(

  • paul mostertman Jan 14, 2011 @ 14:09

    And what if the system reboots? Than again port 80 is in use. So
    # netstat -tulpn| grep :80
    If port 80 is bind to httpd, kill all process:
    # killall -9 httpd
    Now start the httpd:
    # /etc/init.d/httpd start
    fixes the symtoms but it is not the solution.

  • Irwin Apr 13, 2011 @ 10:02

    Thank you so much, great post helpful

  • siros May 1, 2011 @ 13:59

    Thank you so much , This post solved my problem.

  • jlamprung Jul 13, 2011 @ 8:28

    Thanks a lot, you saved my time :)

  • adaedasdad Sep 23, 2011 @ 10:09

    FIRST and foremost thing don’t keep more than 1 ssl config file in /etc/httpd/conf.d/ folder

  • vaibhav Nov 6, 2011 @ 9:52

    Hi,

    I am also having same problem. I have killed and restarted the httpd, afterwards tried to start my server but it didnt worked….

  • Anoop Dec 2, 2011 @ 7:49

    Now its working thankssss………….

  • Sunil Dec 8, 2011 @ 17:32

    Screwed up almost 100s of pages for the solution of this issue…Just a small command “Killall” gave me a way from dark light..thkx guys….

  • jitendra singh tomar Dec 19, 2011 @ 5:59

    How can I know that my board MAC address is already in use or it’s free to use. That means How can I identify that someone else is using my Board’s Mac address or not ? Please post the command if it’s available.

    Thanks in advance

  • guest Jan 17, 2012 @ 15:42

    If you are trying to bind to port 80, you may also want to try disabling selinux to see if that is an issue.

    echo 0 > /selinux/config /selinux/config <-enable

    The above tmp. sets that seeing and reboot clears it. To permanently set it to disabled

    vi /etc/selinux/config

    change
    SELINUX=enforcing
    to
    SELINUX=disabled

    Reboot or put in the temp change above until you can reboot.

  • Pothi Kalimuthu Feb 19, 2012 @ 7:53

    Thanks, Ted Sheckler. What you mentioned is correct. There were two declarations of 443.

  • Dead.Zone Dec 2, 2013 @ 15:22

    Great . Ted Sheckler

    here is best way to disable selinux ! kloxo is need to disable it :)
    change
    SELINUX=enforcing
    to
    SELINUX=disabled

  • launchpad Oct 14, 2014 @ 4:16

    hey.
    thanks a lot. it saved a lot of time.

  • Siva Apr 15, 2015 @ 6:53

    Hi,

    Thanks for the post. It helped in getting up the server once again and save time & effort.
    RedHat & Httpd

  • Solo Jul 29, 2015 @ 17:22

    Omg thank you!!!

  • Yakup Öztürk Dec 18, 2015 @ 7:35

    Thank you my friend. You solved my problem

    • Vikram Jan 28, 2016 @ 10:16

      This error is possible due to many reasons. one of the is as below.

      If you have configured your apache with a listen address that is hitting 80 or 443 and if there is a duplicate entry in the same file, you would see this issue.
      Ex: Listen marsp1uat01-indianrails.com:80 (You see if this is configured more than once in the same .conf file)
      So, just remove the duplicate entry, save the .conf file and try to start it.

  • Savaş karahan May 9, 2016 @ 11:41

    Thank you Frend

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.