Accurately tracking this can be harder than it seems.
At its simplest level:
netstat -ib
will show you the total volume of traffic over the interface since the machine booted.
It would be trivial to run this periodically and calculate the difference between the last reading and the current one.
However, this will count ALL traffic, including local traffic (which your ISP doesn't see), broadcast traffic, ARP, etc. and therefore may overstate the billable traffic.
An alternative is to parse your Apache logs to track http traffic, as well as generate pretty graphs of usage by time, day, referers, etc.
There's a number of packages that will do this including
Analog
However, this won't take account of other traffic on your line that you are billed for.
In short, there's no perfect solution, but if all you're looking for is a ballpark then they may work.