How can I monitor bandwidth usage by Virtual Host in Apache on Ubuntu

Solution 1:

What you are looking for is: mod_logio
http://httpd.apache.org/docs/2.0/mod/mod_logio.html

This will allow the logging of input and output number of bytes received/sent per request. You would then pull it from your logs of a particular vhost. I believe apps like Webalizer will read the log then for you and give you a good usage picture.

Some references:
http://www.debian-administration.org/users/chris/weblog/2 http://onlamp.com/pub/a/onlamp/2007/02/02/apache-debugging-logs.html