{"id":149,"date":"2009-10-01T18:50:36","date_gmt":"2009-10-01T22:50:36","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=149"},"modified":"2013-03-20T08:40:12","modified_gmt":"2013-03-20T12:40:12","slug":"howto-check-apache-connections","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/howto-check-apache-connections","title":{"rendered":"Howto: Check Apache Connections"},"content":{"rendered":"<blockquote><p><span style=\"color: #0000ff;\"><strong>How to check number of connections to the Apache server?<\/strong><\/span><\/p><\/blockquote>\n<p>netstat command will show you the accurate connections to each of your service. In order to check the number of connections to port 80, use the netstat command and grep the Apache port.<\/p>\n<p>List the connections to port 80:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>netstat -alntp | grep :80<\/strong><\/span><\/p><\/blockquote>\n<p>To check the number of connections to port 80:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>netstat -alntp | grep :80 | wc -l<\/strong><\/span><\/p><\/blockquote>\n<p>List the remote IPs connecting to your server on port 80:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>netstat -alntp | grep :80 | awk &#8216;{print $5}&#8217; | cut -d: -f1 | sort<\/strong><\/span><\/p><\/blockquote>\n<p>List the uniq remote IPs and the number of connections from each IP:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>netstat -alntp | grep :80 | awk &#8216;{print $5}&#8217; | cut -d: -f1 | sort | uniq -c | sort -n<\/strong><\/span><\/p><\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong>Please note:<\/strong><\/span> If you copy paste the above commands on your server, the single quote around the {} brackets may change to dots (.) and the command will fail, so make sure you replace those dots with the singe quote and execute the command.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to check number of connections to the Apache server?<br \/>\nnetstat command will show you the accurate connections to each of your service. In order to check the number of connections to port 80, use the netstat command and grep the Apache port.<br \/>\nList the connections to port 80:<br \/>\nnetstat -alntp | grep :80<br \/>\nTo check the number of connections to port 80:<br \/>\nnetstat -alntp | grep :80 | wc -l<br \/>\nList the remote IPs connecting to your server on port 80:<br \/>\nnetstat -alntp | grep :80 | awk &#8216;{print $5}&#8217; | cut -d: -f1 [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[597,173,172,598,599,170,601,171,600],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/149"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":8,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":151,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/149\/revisions\/151"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}