DN Media Corporation

Domain Name Investing & Web Development

AWStats for All Domains

By Michael Sumner • Aug 17th, 2009 • Category: Web Development

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…

PHP script to view stats for all domains combined in AWStats.

Share/Save/Bookmark

Related posts:

  1. Drop Catching Script Yesterday I showed you how to create a bulk availability...
  2. Vanity Name Servers I recently figured out a cool trick to create your...
  3. Register Domains Via SMS Have you ever been away from your computer and thought...
  4. Selling Ad Space In the past few weeks I have been contacted by...
  5. Live Web Site Analytics If you think Google Analytics is cool, prepare to be...

5 Responses »

  1. This could be just what I’m looking for. But I don’t understand what to do with it. Where do I upload the script? If I upload to the main domain directory, it just prints out the code when I load the page. Thanks for sharing!

  2. Christy, it shouldn’t matter where you upload the script since it is just faking a login to your CPanel and collecting the stats for all the different domains on your hosting. If it is just printing out the code, it sounds like you don’t have PHP installed on your hosting account.

  3. Thanks for very quick reply :) No, I definitely have php. Hosting is with Hostgator and I have a ton of WordPress sites (thus the desire for this script). I’ll see what I can figure out.

  4. Hmm, just a thought, did you accidentally save it as .phps instead of .php? That’s the only other thing I can think of.

  5. IThe code kept getting changed when I downloaded or saved directly from here. So I just copied the code as it showed up on the screen, pasted and saved as php file again and all is well. I put it into a password protected directory just to be safe since you don’t have to log in to see the stats. Definitely serves well for the short term. Thanks again.

Leave a Reply