Wednesday, November 16, 2005

Address already in use: make_sock: could not bind to address - Apache - HTTPD Error

So I was getting the following error on one of my servers.


Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443
no listening sockets available, shutting down
Unable to open logs!


The fix is as follows. Run the following command


netstat -lnp | grep '0.0.0.0:80'
# output
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 30982/crond


In my case the output showed that crond was using the port. I ran the following to learn more


ps 30982
PID TTY STAT TIME COMMAND
30982 ? S 0:34 crond


I tried the following a couple of times

service crond stop


and then

service httpd restart
Stopping httpd: [FAILED]
Starting httpd: [ OK ]


and later


service crond start
Starting crond: [ OK ]


Everything started working. Hopefully it will work for you too (I'm not responsible if something breaks on your server).

24 Comments:

At Tue Nov 29, 03:32:00 PM, Anonymous Anonymous said...

i was getting much the same error for port 443. Recently-installed SELinux seems to be at fault.

 
At Mon Dec 19, 12:39:00 PM, Anonymous Jacob said...

I had the same problem starting an apache server. After using the netstat command to identify the process, I just kill -9'd it and apache started right up. Thanks for posting this!

 
At Tue Jun 20, 03:35:00 PM, Anonymous Tormod Guldvog said...

For me, the netstat didn't output anything. I tried to stop any process that might be using ports but in the end it got a bit unwieldy, so I simply rebooted my box and *phew* Apache worked fine after the boot. I have no clue what caused the "Address already in use".

 
At Tue Jul 25, 03:23:00 PM, Anonymous Anonymous said...

thanks a ton for this post. My problem was a skype process blocking the port. No idea how I would have solved it without this post.

 
At Sat Aug 26, 11:12:00 PM, Anonymous Anonymous said...

Thanks a lot, this helped
A perl script blocked the port..what script-i need to find out

 
At Tue Sep 05, 04:37:00 AM, Anonymous Anonymous said...

I had the same problem, although not caused by crond. But the netstat tip really helped me to identify what was going on.

 
At Thu Nov 09, 10:46:00 AM, Anonymous Anonymous said...

thanks for this post. My problem was apache process blocking the port. No idea how I would have solved it without this post.

 
At Fri Nov 17, 01:47:00 PM, Anonymous Anonymous said...

Thanks a lot! In my case it turned out that apache-perl was hogging the port from before and now I have fixed it.

Glad you posted this one

 
At Sat Nov 25, 12:17:00 AM, Anonymous Anonymous said...

wena onda! si me funciono,pero en el grep '0.0.0.0:80', lo busque solo con ':80' ya que no me retornaba nada en la salida...

 
At Fri Dec 01, 06:13:00 AM, Anonymous Anonymous said...

En mi caso habia editado el archivo httpd.conf, y por error coloque otra directiva como esta:
Listen 80
por lo tanto habian dos, esa era la razon del error

 
At Fri Dec 08, 06:56:00 AM, Anonymous salalex said...

Thank you VERY MUCH!

Man, you solved my problem:
"netstat -a -n -b"
- figured out that Skype was listening to 80.

Than I could start Apache:
"\Apache2\bin>Apache.exe -k install"
- install as a service

Best reagards!
Alexander Salnikov

Skype: "sal-alex"

 
At Tue Jan 16, 11:21:00 AM, Anonymous Anonymous said...

Hi,

You tip helped me. Thank a lot!

 
At Mon Jan 22, 09:13:00 AM, Anonymous Anonymous said...

this post is glorious, a reminder of using netstat was all i needed, for me IIS was running, must have gotten reenabled after my program files directory got wiped

 
At Thu May 31, 10:34:00 AM, Anonymous Anonymous said...

Thanks Frank, your tip worked for me. In my case apache was using that port but would not stop untill i used your tip.

 
At Sat Jun 16, 03:42:00 AM, Blogger Faisy said...

in my case I have get this

netstat -lnp | grep '0.0.0.0:80'

tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 6495/skype

I stoped the skype and run the following

service httpd start
Its working fine thanks for help

 
At Fri Jun 29, 02:46:00 PM, Anonymous Anonymous said...

THANKS BIG TIME! spent three hours fixing this issue, then i found your blog.

 
At Sun Aug 05, 05:59:00 AM, Anonymous Anonymous said...

thanks for the post, i thought i wont able to finish my project.. i just type netstat and rebooted my computer and WHALAAA!!! everything is back to normal. tnx men ^^

 
At Mon Aug 27, 12:09:00 PM, Anonymous Anonymous said...

Thanks works great for me, but in my case the php was taking the port, if anyone can help why that happening will be very helpfully! my mail is chactuchac10@yahoo.com.ar

 
At Wed Sep 05, 02:57:00 AM, Blogger Richard said...

Good post = Made me look like a Linux Guru.


Thanks

 
At Wed Sep 19, 05:04:00 AM, Anonymous Anonymous said...

thanks a lot you solved my prob!!!!

Adrián

 
At Thu Feb 07, 03:12:00 AM, Anonymous Anonymous said...

Same problem on Windows, and turned out it was Skype too. From command prompt, NETSTAT -ao | find /i "listening" This showed a process attached to [machinename]:http , and after reading other comments on this page just guessed it was Skype. Shut down Skype and Apache service started.

 
At Fri Feb 08, 07:59:00 AM, Anonymous Nripendra said...

Really a very helpful post. i had the same problem,Surgemail was running on the port 80.

I simply stop the sergemail and it worked fine...

thanks for the post
Nripendra

 
At Wed Feb 20, 01:17:00 AM, Blogger AeroToys said...

In Solaris, I tried netstat and could see port 80 bound but no descritpion of the process was given.

Solved the problem by

svcadm disable httpd
check netstat -na | grep .80 | more
svcadm enable httpd

Hope it helps to Solaris 10 uses.

 
At Mon Feb 25, 03:14:00 AM, Blogger AB said...

Beautiful..Crisply written. Helped me solve my problem! Thanks a lot!

 

Post a Comment

Links to this post:

Create a Link

<< Home