utorok 7. februára 2012

How to unbind port

From time to time apache after restart doesn't close used ports and You have to restart server. This we don't want. Solution is pretty simple:

find process IDs

$ lsof -i TCP:80


output:


apache2 16442 www-data 3u IPv4 1158908 0t0 TCP s0.domain.tld:80 (CLOSE_WAIT)

...



then we kill process(es)

$ kill -9 16442