I came across a limitation of AWStats today that, much to my surprise, has not really been addressed effectively. For those of you that have cPanel and AWStats installed on your server, and host multiple domains on the same box, you may have noticed this too. The way you normally see your AWStats is to log into cPanel, click on AWStats, and then it brings you to a list of all the domains you host on that server. You then click on a single domain to view the traffic stats.
However, if you want to quickly get a glimpse of the traffic across your entire network of sites (maybe to give to prospective advertisers or investors), your only option is to click on each domain individually and create a spreadsheet. There is one script I found called AWStats Totals, but it seems to assume your AWStats directory is in a public_html (or www) folder that can be viewed directly. In most cases, AWStats is installed in a directory below that, and you can only access the logs from cPanel. Also, it seems insanely hard to configure.
So after searching for the better part of an hour to find a script that would work for my hosting configuration, I decided it would be quicker to just write one myself. You start out by selecting a month and a year. It then logs into your cPanel to get a list of all “addon domains”, then logs in to the stats pages one at a time, collects the information, and then displays it on the screen with totals at the bottom. I’m not sure how many setups this will work on, but you should be fine if you have cPanel on the x3 theme, and a current version of AWStats.
Configuration is very simple, just enter your cPanel username and password, and your primary domain name, and you’re good to go.
Hope this helps someone…