I have a standard reseller hosting account. The main account has WHM and all sub accounts run cpanel. All sub accounts also have stats on them in the form of:

  1. AWStats
  2. Webalizer

My question is, is there either a script, or some way through php, that I can run a script that will check all my subaccounts for the sites with the most unique hits in a certain month, and then give me a top 10 breakdown of them?

link|improve this question

60% accept rate
1  
Belongs on Server-Fault – Andrew Moore Aug 8 '09 at 6:29
What do you mean by the 'most unique hits'? – Marco Demaio Aug 19 '10 at 12:24
feedback

migrated from stackoverflow.com Aug 8 '09 at 8:15

This question came from our site for professional and enthusiast programmers.

2 Answers

WHM > Account Information > View Bandwidth Usage

This will take you to the Bandmin overview page. Bandmin is installed with WHM (at least at the systems I use). More details can be found here

link|improve this answer
"sites with the most unique hits"... NOT bandwidth. – RD. Aug 8 '09 at 9:35
feedback

Yes, but I don't know if there is a ready to use script, definietely you can write one on your own if you know a bit of PHP. Awstats is basically saving all the results in ready to use format under the /home/your_cpanel_user/tmp/awstats

If you look into that folder you find many txt files, one for each month for eqach domain/addon domain you host on that cPanel account.

So for instance the file awstats012007.domain.com.txt will be the summarized visits/hits results o domain.com for January/2007.

If you open such file you will find a table of results under the string:

# Hour - Pages - Hits - Bandwidth - Not viewed Pages - Not viewed Hits - Not viewed Bandwidth

The 3rd column are the hits.

So you need a PHP script that opens the files takjes the hits and perform the calculations you want.

Hope it helps.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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