Apachetop is a small utility that lets you view real-time queries performed on an Apache web server. Its operation is very similar to top command, found on Linux.
To install Apachetop on a Debian-based distribution, run the following command:
sudo apt-get install apachetop
Or this one for a RPM based distribution:
yum install apachetop
If you use Redhat 5.5 or CentOS 5.5, you will first add the EPEL repository on your system.
To use Apache top, you can run this command, which indicates the portion where the server log file:
for apache2 server :
apachetop -d 1 -f /var/log/apache2/access.log
for httpd server :
apachetop -d 1 -f /var/log/httpd/access_log
You will surely notice the possibility of moving the star (* symbol) with the arrow keys up and down on your keyboard. This allows you to select a query and then get the detail with the left and right keys.
Finally, here are some useful keyboard shortcuts:
* h: show help
* d: change the display mode (url, host, referrer)
* n: classification error code
* s: change the sort order
* p: pause
* q: quit