Address already in use: make_sock: could not bind to address 0.0.0.0:80

Hello to all,

Recently, every 6-8 hours or so, our server’s HTTPD service stops responding.
If I try to do a simple restart, it complains with:

Address already in use: make_sock: could not bind to address 0.0.0.0:80

Then, to fix it, I have to proceed to locate all active httpd PIDs and kill them.

netstat -ltnp | grep ‘:80’
kill -9 [process]

But this situation is happening frequently now and I would like to know what could be causing it.

Could anybody shed a light on what could be causing this behavior so I can fix it for good?

Thanks a lot for any help to solve this issue.

Regards,

Rodrigo

Not sure if this will help you: http://www.linuxquestions.org/questions/linux-software-2/98-address-already-in-use-make_sock-could-not-bind-to-address-0-0-0-0-443-a-110753/#post1153056

Hi Michael and Crservers

There’s a good explaination I thought.

If this continues though, we would need more information to help or if you prefer not to divulge, you would be best advised to open a support ticket with IW.

If you could post what the solution was to this, it would be good for all IW users if you don’t mind.

Many thanks

John

Yeah, I thinking about opening a ticket.
Commenting out the Listen 80 directive in httpd.conf does not seem like a good idea as the previous link suggests
Thanks to all.

Hi Crservers

Michael link was good but I don’t think it relates to you issue, as your apache starts and remains up for over 6 hours, according to your post.

I think it might be a memory issue, ie your memory is deplited and hence why some child’s cannot be stopped, which I’m thinking is when graceful restart for apache kicks in.

It could also be your spawning to many children and thus is causing memory depletion.

Your port binding failing due to port in use is because your child’s are still using port 80.

Hence, why I suggested you may not want to share but ofcourse, I could be wrong sorry.

I hope that helps a little and if you do not mind, it would be lovely if you could post back what the issue was and how it was fixed.

Many thanks

John

Yeah, definitely open a support ticket with us so we can see what’s going on. Not sure if it’s iworx related or something else offhand, but our support techs should be able to sort it out. https://support.interworx.com

Hi

Please could I ask if anyone is also showing this issue and if this temporary fix should resolve it. I know it is not ideal, but it is on production servers where we have seen this issue. The following should I believe kill all apache processes on port 80, leaving iworx working normally.

If you know of a better way, please share if possible.

SSH to server

vi /etc/init.d/httpd

locate the following lines

restart)
stop
start

add the following line

fuser -k -n tcp 80

and it now reads as

restart)
stop
fuser -k -n tcp 80
start

save and quit

service httpd restart