I have a webserver that runs a number of virtualhost websites.

Every once in a while there will be a situation where the server load goes really high, or the network response is very slow on the webserver, and I would like to have a way of viewing the current activity on my varions virtualhosts, to see if a particular domain is perhaps responsible (ie. DOS, etc.)

What tools exist that can show me this information?

(note, I have about 10 IP addresses on the webserver, but all of them are shared between many domains/virtualhosts)


mod_status is great for this, if you turn on ExtendedStatus it shows you the list of URLs currently being serviced. Turn ExtendedStatus off when you don't need it, though, as it does cause a (slightly noticeable, in extreme cases) reduction in performance.

  • Yes, that is almost what I want. The problem is that the list is long and not sorted in any useable way. Are there any frontend plugins that would consolidate this info so that, for instance, the most active VirtualHosts are listed at the top with a percentage?
    – Brent
    Nov 20 '09 at 17:31
  • If one vhost is getting the snot hammered out of it, it should be pretty obvious from a quick glance over the URL list.
    – womble
    Nov 20 '09 at 17:59
  • True. And for the specific case I mentioned, this would be a good solution. I guess I was hoping to have something more general purpose as well.
    – Brent
    Nov 20 '09 at 18:03

Have you tried Apachetop


(Larger article about it here: http://www.howtogeek.com/howto/ubuntu/monitor-your-website-in-real-time-with-apachetop/

  • This looks useful - but all of our access logs are separated per-domain (a couple hundred), and it looks like this tool wants to parse a single log file. I suppose I could somehow pipe *.access.log through sort to get a single stream, but the load that would put on the system would be pretty high.
    – Brent
    Nov 20 '09 at 17:08
  • You could limit the size of each log to N number of lines and then cat them together into a single larger log and let apachetop do its thing. Jan 19 '12 at 8:22

If you are using a particular monitoring technology already, you should mention it.

But in general, you can put the following directives in each virtualhost block to log that virtual host separately, and then just parse the logs with whatever you use:

ErrorLog /var/log/httpd/foo_vhost-error_log common
CustomLog /var/log/httpd/foo_vhost-access_log common

Then just adjust log rotate if you need to. Then, if you had daily logs, you could do something really simple to get the hits like looping over the logs and calling wc -l on each of them.

  • I am already logging these stats, and can use awstats to see the traffic domain-by-domain - for the previous day (since the reports are generated nightly). What I am looking for is something to graphically compare the live activity between domains (VirtualHosts)
    – Brent
    Nov 20 '09 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.