<Location /admin/server-status>
SetHandler server-status
Order deny,allow
</Location>
ExtendedStatus On
ls -la /var/log/httpd/*access?logAlthough the path and the mask to match access logs vs error/other logs may vary.
for vhost in `grep ServerName /etc/apache2/sites-available/default | awk '{ print $2 }'`;do echo $vhost: `grep $vhost /var/log/apache2/access.log | wc -l`;doneThe backtick-quoted part in the for loop just needs to result in a list of vhosts. In my case it's straightforward to just grep for the ServerName directory in Apache's config and print its argument. You could also just write them out in a file and replace that part with `cat thatfile`. /var/log/apache2/access.log should be the actual combined log.
If that's the case, setup the analyzer to run every 10 minutes, or on demand, or whatever. That way you can get up-to-date analyzed logs when you want.
Otherwise, you can always do it manually and parse the logs using perl. Grab the last 5000 entries from the log file, and count the number of times each domain comes up. That works out to less than a page or two of code, and you can get the details in nearly real time.
posted by cschneid at 12:01 PM on September 8, 2008