I use AWStats along with separate log files for all my vhosts. You should be able to do it with one log file, but if you miss a configuration option, you're going to get vhost statistics mixed in with other vhosts. There is a big drawback to my setup though. If you have lots of vhosts, this isn't going to work for you, Apache will lock up opening too many file descriptors on log files. With fair warning out of the way...
In Apache config, if it isn't already setup, you'll want to let Apache know to not log virtual hosts to your main log file and also a logformat describing the format to log to for AWStats (my config uses the standard NCSA combined log format, it might already be configured in your Apache config):
Code:
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog logs/access_log combined env=!VLOGThen in each of your virtualhost definitions (depending on where you want to see your logs):
Code:
CustomLog logs/access_log_myvhost combined
The rest of the setup is croning AWStats to run whenever you want stats updated (the more often the better since AWStats knows where it left off in the log files, and can spread out it's work load, especially if you enable DNS lookups, not advisable on high traffic sites).
In your AWStats config files, the variables you'll want to make sure you've set are:
Code:
LogFile="/var/log/apache2/access_log_myvhost"
LogType=W
# Here's where that NCSA standard comes in handy, you
# don't have to specify you're entire custom format since
# AWStats has a setting for the standard.
LogFormat=1
SiteDomain="mydomain.tld"
So long as you have those ones set right, you should be fine, but it's always a good idea to go through the entire config file of course. The important settings should be right up top.