Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm running a Debian webserver with Apache2 and the restart command started giving me an error.

root@srv:~# service apache2 stop
Stopping web server: apache2.
root@srv:~# service apache2 start
Starting web server: apache2(98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
 failed!

Occasionally it actually will restart without a problem but usually I have to killall -9 apache2 first. Someone on the Debian IRC had me check my active apache2 connections and it turns out they aren't quitting and dozens of them are staying open. How can I get these to eventually time out?

share|improve this question
1  
Have you tried using Apache's graceful restart? service apache graceful –  Mike Nov 18 '11 at 22:19
    
What's the output of: netstat -lnp | grep :80 –  Tim Johnson Feb 26 '12 at 17:11

1 Answer 1

Try

lsof -i :80

and then kill the associated PID.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.