Who’s connecting to Apache?

Here are a few more one liners that I use quite often to locate large number of apache connections, large numbers of site connections, the busiest site on the server and busiest script on the server.

large number of apache connections

netstat -plan | grep :80 | awk '{print $5}' | sed 's/:.*$//' | sort | uniq -c | sort -rn |head

site connections

/usr/bin/lynx -dump -width 500 | awk 'BEGIN { FS = " " } ; { print $12 }' | sed '/^$/d' | sort | uniq -c

busiest site

/usr/bin/lynx -dump -width 500 | grep GET | awk '{print $12}' | sort | uniq -c | sort -rn | head

busiest script

/usr/bin/lynx -dump -width 500 | grep GET | awk '{print $14}' | sort | uniq -c | sort -rn | head

Try it for yourself!


I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.