Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

I'm running an Ubuntu 10.04 server that hosts several domain names. All domains point to the same IP address and use the same network interface. I'm really only concerned with the main domain name such as and It should include subdomains such as with the totals for Is there a tool out there that is configurable to track bandwidth usage on a per-domain name basis?

Edit: I'm not looking for only web usage. I'm looking for all traffic.

share|improve this question

marked as duplicate by Iain, sysadmin1138, John Gardeniers, splattne Jan 17 '11 at 13:18

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

I assume you're looking for bandwidth usage for the webserver? Are you looking for this in real time or are you looking for a log processor that can split the data downloaded per site? – DerfK Jan 16 '11 at 18:40
If you use multiple apache instances on different ports, you could use MOD_STATUS module to query them. I did this via Zenoss all the time. – SpacemanSpiff Jan 16 '11 at 19:44
Just to be clear, in addition to "web" traffic (I'm assuming you mean HTTP/HTTPS), what other traffic needs to be counted? – John Gardeniers Jan 16 '11 at 21:04
up vote 1 down vote accepted

There is no way of monitoring traffic for all services using a domain name. You would need to have an IP for each domain name to do that. You could potentially monitor the usage for given services depending on if those services maintain information in requests that preserve the domain name. One such service is a web server doing virtual hosting. Web servers doing virtual hosts need to know the domain name to resolve virtual hosts.

share|improve this answer

You can use the server logs to determine how much bandwidth you are serving up. A tool like awstats will report the bandwidth served. Incoming bandwidth is not reported, but is usually significantly less the outgoing bandwidth.

share|improve this answer

The short answer is No you can't do that.

The long answer is, you can in a limited way do it.

Short answer: can't because DNS will resolve the request to an IP address and then the client will connect to the IP. There is no way of telling which hostname it was requesting once DNS has converted it.

Long answer: The HTTP 1.1 protocol requires a "host:" header. i.e. the browser sends the hostname that it is requesting to the web server. This is how a web server knows what website to dish out. This is how virtual hosting is able to work on the same IP address. So, theoretically for HTTP you'd be able to work out how much traffic was going to and coming from each address.

Other network services may have similar features as HTTP. But, again many do not. Therefore, it's only really partially possible.

There are many tools that log HTTP traffic statistics & load for HTTP. I'm not sure which ones can do this per website. e.g. rrdtool may be a good option

share|improve this answer

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