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?

link|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 at 17:11
feedback

1 Answer

Try

lsof -i :80

and then kill the associated PID.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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