Monitor Apache Activity with mod_status

Monitoring a server can be a full-time job in itself, especially if your dedicated server hosts multiple websites. In Apache HTTP Server, each website is setup as a virtual host with its own set of logs. To monitor each independently is impossible when you have multiple sites. Instead, some system administrators just monitor the main Apache logs and hope for the best.

If this makes you a little uneasy, there is a way to get more in-depth monitoring of your Apache activity. It is called mod_status. With it you can have real-time monitoring of your web server’s activities, and many Linux distributions include it as part of the default installation.

Among the things mod_status monitors are:

  • number of worker serving requests
  • the number of idle workers
  • status of each worker, the tasks they are performing, and total bytes served
  • total bytes accessed and served
  • server restart times and the length of time it has been running
  • average requests per second, bytes served per second, and average bytes per request
  • CPU usage for each worker and total Apache CPU usage
  • list of current hosts and requests being processed

All of this information is sent to an HTML page for easy reading so that you can get live statistics of Apache’s activities and anything that might look suspicious. Rather than waiting for problems to arise and looking at logs after the fact, mod_status allows you to potentially see problems early on and find fixes.