الجمعة، 28 مايو 2010

How to Check Apache Connections

Apache is one of the famous web services and surpass for more than 100 Million website.
If you have experience in Server Administrator task, you surely headache on the Apache connections when it is getting tons of connections to the server. But, how could you going to check for those connections?
Some command like netstats, grep, ps, etc will very helpful to help you to understand the number of connections of the server.
Mick Genie will guide you some ways to list the Apache connection as below.
Grep port 80 (web services port)


 netstat -alntp | grep :80 

Check the number of connection from port 80
netstat -alntp | grep :80 | wc -l
 
 ps auxw | grep httpd | wc -l 


List the remote IPs connecting to your server on port 80

 
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c |  sort -nr 
 
List the unique remote IPs and the number of connections from each IP

netstat -alntp | grep :80 | awk ‘{print $5}’ | cut -d: -f1 | sort |  uniq -c | sort -n



ليست هناك تعليقات:

إرسال تعليق