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

by on September 18, 2006 · 28 comments· last updated at September 26, 2007

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

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.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 28 comments… read them below or add one }

1 vijay prakash February 7, 2007 at 1:28 pm

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

Reply

2 bbm4n November 24, 2007 at 10:44 pm

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

Reply

3 Vladimir May 8, 2008 at 11:12 am

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

Reply

4 Active July 13, 2008 at 3:14 am

The post has helped us a lot.

Reply

5 abbas September 19, 2008 at 7:16 am

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

Reply

6 thx October 28, 2008 at 12:04 am

Shortest solution to my problem. Thanks!

Reply

7 Libran24 January 20, 2009 at 7:51 pm

Thanks. Worked great !!

Reply

8 terminator August 18, 2009 at 12:15 am

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?

Reply

9 Ted Sheckler August 18, 2009 at 11:06 pm

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.

Reply

10 ZeroCool September 2, 2009 at 7:59 am

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

And Start Apache

Reply

11 The Plague April 15, 2012 at 11:22 pm

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

Reply

12 Flyboy November 12, 2009 at 8:10 pm

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!!!!!

Reply

13 Igor December 20, 2011 at 9:03 am

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

Reply

14 oucil February 18, 2010 at 6:45 pm

Saved me @$$, tanks!

Reply

15 Viet Ngo May 2, 2010 at 3:17 pm

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

Reply

16 Jack Read November 10, 2010 at 4:11 pm

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

Reply

17 artur November 18, 2010 at 6:11 pm

it does’t help me…^(

Reply

18 paul mostertman January 14, 2011 at 2:09 pm

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.

Reply

19 Irwin April 13, 2011 at 10:02 am

Thank you so much, great post helpful

Reply

20 siros May 1, 2011 at 1:59 pm

Thank you so much , This post solved my problem.

Reply

21 jlamprung July 13, 2011 at 8:28 am

Thanks a lot, you saved my time :)

Reply

22 adaedasdad September 23, 2011 at 10:09 am

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

Reply

23 vaibhav November 6, 2011 at 9:52 am

Hi,

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

Reply

24 Anoop December 2, 2011 at 7:49 am

Now its working thankssss………….

Reply

25 Sunil December 8, 2011 at 5:32 pm

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….

Reply

26 jitendra singh tomar December 19, 2011 at 5:59 am

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

Reply

27 guest January 17, 2012 at 3:42 pm

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.

Reply

28 Pothi Kalimuthu February 19, 2012 at 7:53 am

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

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , ,

Previous Faq:

Next Faq: