Due to an activity scheduled on the server, I had stop the apache process and then restart when the activity completed. The activity started at 9am and ended around 9 pm.
To list the apache processes that were running on the server before I stopped it, I used ps -ef | grep apache, and these were the processes listed :
/opt/hpws/apache/bin/httpd -d /opt/hpws/apache -k start
/opt/hpws/apache/bin/httpd -k start -DSSL -f /opt/hpsmh/conf/smhpd.conf
I stopped the processes by replacing 'start' with 'stop' in the commands above.
These processes were stopped.
However, when I attempted to restart the process later on, I received error :
(226)Address already in use: make_sock: could not bind to address [::]:80
no listening sockets available, shutting down
Unable to open logs
I googled for solution, and they have suggested locating duplicate apache listening to port 80. I ran this command, and the output listed below that :
# find / -type f -name *apache*
/etc/rc.config.d/hpws_apacheconf
/tmp/nickel.L28dre01/rc.config.d/hpws_apacheconf
/opt/hpws/apache/LICENSES/apache.manual.LICENSE
/opt/hpws/apache/hpws_docs/apache.admin.guide
/opt/hpws/apache/hpws_docs/apache.release.notes
/opt/hpws/apache/man/man8/apachectl.8
/opt/hpws/apache/newconfig/etc/rc.config.d/hpws_apacheconf
/opt/hpws/apache/newconfig/opt/hpws/apache/bin/apachectl
/opt/hpws/apache/old/opt/hpws/apache/newconfig/etc/rc.config.d/hpws_apacheconf
/opt/hpws/apache/old/opt/hpws/apache/newconfig/opt/hpws/apache/bin/apachectl
/opt/hpws/apache/bin/apachectl
/opt/hpws/apache/bin/apache
/opt/hpws/apache/webproxy/bin/apachectl.wp
/opt/hpws/webmin/hpapache/apache-lib.pl
/sbin/init.d/hpws_apache
How do locate any duplicate apache entries listening on port 80?
Any other ways to resolve this problem?
Hello anaigini45,
Above tell us there is some process which is definetly running on port 80 and occupying it. On first place you should check if there is any process or not. Also plese make sure there are no older processes related to apache is running already.
You could check by doing following which process is running or not on port 80 by following command(Not tested though).
netstat -nlp | grep :80
OR
lsof -i ":80" | grep "LISTEN"
Check also apache process is running or not by doing:
ps -ef | grep -v grep | grep apache
Last but not the least please check error.logs for apache and let us know if you see some specific errors there too.
I hope this helps.
Thanks,
R. Singh
I doubt that HP-UX netstat has p and l options. But the following should work
netstat -n | grep -w 80
Also it might follow an old RFC and keep the port open for 10 minutes after a service stop.
1 Like
lsof provides this output :
# /usr/local/bin/lsof -i ":80" | grep "LISTEN"
top 13106 www 3u IPv6 0xe00000038137cac0 0t0 TCP *:http (LISTEN)
top 13179 www 3u IPv6 0xe00000038137cac0 0t0 TCP *:http (LISTEN)
#
netstat provides this output :
# netstat -n | grep -w 80
tcp 0 0 10.61.1.121.80 192.168.11.41.15379 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20437 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15260 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52677 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.28178 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.29.19.52765 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.32385 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53631 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58821 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.29779 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.1139 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26145 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.39307 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52984 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17701 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.18276 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19250 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55205 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55023 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55223 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.41927 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.1585 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48341 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.3975 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.5131 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48492 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55608 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37757 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55392 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.39411 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40343 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.60208 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34374 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13250 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34282 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34326 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40915 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52613 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22009 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.38335 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19741 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20664 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40784 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36310 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.50706 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20467 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.50468 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26706 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48730 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17070 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.59711 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.57807 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.49527 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.35323 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62922 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.42475 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63082 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.2499 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40554 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63161 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.65441 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.43394 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.65437 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.59469 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62198 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62402 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15476 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19536 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15394 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53409 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.54672 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15670 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.54808 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52930 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48392 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52437 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37194 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37922 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.63.13.58848 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.37163 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52543 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22854 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17340 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17164 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17203 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.57065 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37603 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37581 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37544 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34038 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.33650 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.33958 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52044 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15261 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15367 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.27338 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48018 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.46531 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.59247 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.59609 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.12383 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.50456 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17456 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.29.19.52768 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.12308 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.57223 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19631 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40162 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63253 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63411 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63597 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16791 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19851 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.29.19.52764 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55941 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.28796 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55433 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53802 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52404 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.3801 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.3332 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.4360 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.42679 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37366 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13147 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13019 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48803 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.14510 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17001 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17053 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17159 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34804 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55345 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.88.56.55904 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.34668 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17655 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.14908 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.10660 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.54339 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48287 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17465 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.61831 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55131 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48629 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34972 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17410 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.64829 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22823 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53006 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.24551 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40972 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.24875 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.41373 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.1114 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.6718 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.64096 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.64313 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37605 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.35729 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37604 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37693 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58803 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.51912 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.31674 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13464 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.29510 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.47272 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48739 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.31298 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19708 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.27417 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26896 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.28213 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53588 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.35898 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17800 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15926 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.39106 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.15866 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.30983 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.44072 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37104 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37091 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.45966 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.46704 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37166 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62699 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.11276 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.56826 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.48396 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58720 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.64298 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58912 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62559 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.32979 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.62608 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20141 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19847 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.19764 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.61921 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.60425 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.61001 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16838 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16894 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16827 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16643 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.16661 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36374 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37363 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37462 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37526 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26014 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22885 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25710 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22715 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25738 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22277 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.5649 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36854 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58124 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36920 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36925 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17127 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.29365 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.49091 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52063 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.12518 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.12912 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13320 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.34433 CLOSE_WAIT
tcp 0 0 127.0.0.1.80 127.0.0.1.50177 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.29.19.52769 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.50476 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.17431 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.38.135.50563 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55475 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55750 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.55806 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58441 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.40487 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.51225 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25950 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.22444 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.7024 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.52833 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20325 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.5144 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.20146 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.6814 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26047 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.23231 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26086 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.26157 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.23087 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.23025 CLOSE_WAIT
tcp 0 0 127.0.0.1.50177 127.0.0.1.80 ESTABLISHED
tcp 0 0 10.61.1.121.80 192.168.11.41.28793 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.61069 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36277 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.11898 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.8030 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36132 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.9910 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36207 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.64955 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.64341 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.63273 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.58940 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.57689 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.56153 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25527 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25204 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.25508 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.7029 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.51442 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.9175 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.53487 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.13740 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.6749 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36726 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36398 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.36632 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.56069 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37359 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37317 CLOSE_WAIT
tcp 0 0 10.61.1.121.80 192.168.11.41.37274 CLOSE_WAIT
#
Killing the processes from the lsof output seems easy.
However, how do I remove/kill all the "CLOSE_WAIT" and "ESTABLISHED" status of port 80 from the netstat output? (Since there is so many listed).
Is killing the process the option in the first place?
bakunin
September 4, 2016, 4:43pm
5
I am by no means an HP-UX expert, so please take my explanations cum grano salis.
First: stopping/starting/monitoring the apache process: On all systems i used Apache on (various Linuxes, AIX, Solaris) Apache was started and stopped by the apachectl
command. I would be astonished if this is not the case on HP-UX.
Also, the processes are usually not named "apache" but "httpd". Might it be possible that you haven't stopped the (real) Apache-processes at all and this is why all the sockets are in use?
anaigini45:
Killing the processes from the lsof output seems easy.
However, how do I remove/kill all the "CLOSE_WAIT" and "ESTABLISHED" status of port 80 from the netstat output? (Since there is so many listed).
Is killing the process the option in the first place?
A process uses a socket to create a connection. Once this connection is up and running, it appears in the netstat
-list in the status "ESTABLISHED". When this connection is decomissioned again, it goes into the status "fin_wait" (actually there are FIN_WAIT_1 and FIN_WAIT_2 because this is a 4-way handshake process) and the socket is freed up after a certain time. This time can be configured (usually in units of half-seconds) in some kernel-tuning parameter. I don't know how to do that in HP-UX but with this information you should find it by searching the documentation.
CLOSE_WAIT is similar to FIN_WAIT in that the connection is in the process of closing. It means that the local host has received a termination request and has already acknowledged it. If you want to know more details about TCP/IP i suggest W. Richard Stevens excellent book "TCP/IP Illustrated" (3 volumes) - what is not in there isn't worth knowing.
After this little theory excursion: you can kill the processes, but do it by sending SIGTERM ( kill -15
) instead of the all-too-common SIGKILL ( kill -9
)! The difference is that SIGTERM tells a process to end, so it can clean up what it has allocated (that includes closing open connections hence freeing the sockets). SIGKILL will kill the process immediately and all this cleanup work will not be done at all.
I hope this helps.
bakunin
1 Like
Hi,
I tried killing one of the processes listed from the netstat command like this :
# kill -15 37274
kill: 37274: The specified process does not exist.
#
The error is as shown.
How else can I clear all these hogging processes?
Also are these processes the cause of port 80 being blocked? Clearing them will resolve this problem and allow me to start apache without any problem?
RudiC
September 5, 2016, 4:31am
7
Where did you get that number (37274) from?
tcp 0 0 10.61.1.121.80 192.168.11.41.37274 CLOSE_WAIT
bakunin
September 5, 2016, 5:44am
9
That is NOT a process ID, it is the port number. "192.168.11.41.37274" is a "socket": a certain port on a certain IP address.
When we talk about "TCP connections" we are talking about something you can picture like a garden hose, where, instead of water, data can be pumped through (in both directions). This is also called a "virtual channel". The "sockets" are the end points at the two connecting systems where this garden hose is attached. In this case you have two systems connected: 10.61.1.121 and 192.168.11.41. The "garden hose" connects port 80 on the first system to port 37274 on the second.
You really should read the suggested book (or another, but i found this one to be the best to learn from) to understand basic networking concepts.
I hope this helps.
bakunin
1 Like
Finally, the solution for this was to kill the 2 httpd processes listed from the lsof command :
# /usr/local/bin/lsof -i ":80" | grep "LISTEN"
top 13106 www 3u IPv6 0xe00000038137cac0 0t0 TCP *:http (LISTEN)
top 13179 www 3u IPv6 0xe00000038137cac0 0t0 TCP *:http (LISTEN)
#
After killing these 2 processes, all the CLOSE_WAIT connections were gone.
Then, I could restart the apache process once again.
Also check that
ndd -h tcp_time_wait_interval
is 1 minute (60000 miliseconds), not 4 or 10 minutes.
Still this can mean that when you stop a service like apache you must wait 1 minute until you can start it again.
bakunin
September 5, 2016, 8:52am
12
anaigini45:
Finally, the solution for this was to kill the 2 httpd processes
[...]
After killing these 2 processes, all the CLOSE_WAIT connections were gone.
Then, I could restart the apache process once again.
This was exactly what i have told you in first place: the apache processes are named "httpd", not "apache".
bakunin