Step 3: Download the latest version of AWStats.
Goto http://awstats.sourceforge.net or http://www.awstats.org and download the latest STABLE release - currently awstats-6.4.exe (875KB) and is the one config settings used here are for.
Step 4: Install and Configure AWStats.
- Double-Click on the downloaded exe file to begin the installation.

- Click 'Next' to continue

- and then 'I Agree' (to the License Agreement

- Change the Destination folder to something more suitable....

- More suitable would be 'C:\Apache2\'
- AWStats install then creates an 'AWStats' folder inside of this making the full path 'C:\Apache2\AWStats' (future tutorial comments assume this path)-
- .... and then click on 'Install'
- Click on Close to Finish the main installation.
To Configure AWStats for your Site/Server/ActivePerl.
There are two ways of doing this :-
1. Follow the instructions from Step 1 'Install & Setup' which by default appears on your screen after the above install. (Or by looking in C:\Apache2\AWstats\docs\awstats_setup.html)
2. Follow my Quick Setup Instructions below. If doing it this way , maybe take the time to glance at the programs 'Install & Setup' page (as in 1 above) before continuing.
Quick Setup Instructions for AWStats
These instructions assume you have been following the Apache Tutorial and therefore use the setup and directories as described there. Subsitute any directories and file/site names for your own circumstances.
AWStats (and most stat generators) use the log files generated by our Apache server. We configured our Apache server to use the 'combined' method which awstats prefers to use for its site stats.
Just a reminder (or for those that did not follow the Apache tutorials) , our log files are stored in "C:\Apache2\Apache2\logs\" directory and the log file names are based on our site name. So 'yoursite.com' will have two log files named after it called 'yoursite.com-error_log' and 'yoursite.com-access_log'. It is this second log that we need to tell awstats to use, and its location. We do this in a few minutes, first of all we need to move some files around.
- Copy ALL files and sub-folders contained within "C:\Apache2\awstats\wwwroot\cgi-bin\" and paste into your Apache2 'cgi-bin' folder - "C:\Apache2\Apache2\cgi-bin\"
- Copy ALL files and sub-folders contained within "C:\Apache2\awstats\wwwroot\icon\" and paste into our Apache2 'icons' folder - "C:\Apache2\Apache2\icons\"
Note : Most versions of AWStats from about version 5.8 upwards create alias directory entries in your Apache httpd.conf file (at the bottom) making the above file copying not really neccesary, however I like to keep them where I put them above and remove the httpd.conf entries, so I don't have more than one CGI executable directory, it's entirely up to you.
Thats the copying done, now we need to edit just two files and we are done.
Edit 'awstats.pl' located in "C:\Apache2\Apache2\cgi-bin\" and change just the path on the first line to point to "C:\Apache2\perl\bin\perl.exe" so it should now look like this (it might contain symbols if edited in Notepad so open in Wordpad instead)
#!C:\Apache2\perl\bin\perl.exe
Basically we are pointing the awstats.pl file to our perl.exe program
we installed earlier, so if yours is placed elsewhere then change the above
file path accordingly - or awstats wont work!
If you glanced down this file briefly and thought 'oh hell, what have I let
myself in for here' - don't panic, we have finished with this particular file
now and dont need to know any of that stuff! So save and close 'awstats.pl'
overwriting the original.
Now find the awstats.yoursite.conf (newly created during the install by AWStats) and open it for editing. (This file is in the same directory/folder as the 'awstats.pl' we just edited a minute ago.)
Within 'awstats.yoursite.com' find and replace the following :-
--------------------------
Main Setup Section
--------------------------
- Find : LogFile="/var/log/apache/access.log"
Replace with : LogFile="C:/Apache2/Apache2/logs/yoursite.com-access_log" - Find : SiteDomain=""
Replace with : SiteDomain="www.yoursite.com" - Find : HostAliases="localhost 127.0.0.1 REGEX[^.*\.myserver\.com$]"
Replace with : HostAliases="yoursite.com localhost 127.0.0.1"
(You can include alias names from DynDns.org accounts such as www.mysite.serveftp.net etc etc...) - Find : DirIcons="/icon"
Replace with : DirIcons="/icons" - Find : AllowToUpdateStatsFromBrowser=0
Replace with : AllowToUpdateStatsFromBrowser=1
--------------------------
Optional Setup Section
--------------------------
- Find : DefaultFile="index.html"
IF NECCESSARY replace with your default index page.
I use SSI for my SideNavBar and so need to use the .shtml extension on all my pages.
Therefore my line looks like : DefaultFile="index.shtml"
So that you dont include stats from your own local machines, they will remain in the actual log files but excluded from awstats counts - believe me, to get 'true' figures you might like to do the following sometime, but is not essential at this stage.
- Find : SkipHosts=""
Replace with : SkipHosts="127.0.0.1 REGEX[^192\.168\.] REGEX[^10\.0\.]"
All done, now all we need to do is take a look at our site stats and check its all working.
Either goto 'http://localhost/cgi-bin/awstats.pl?config=yoursite' in your web browser or 'http://www.yoursite.com/cgi-bin/awstats.pl?config=yoursite' and all your stats you have collected so far for the current month should be showing.
I encourage you to view all the readme files and config options associated
with awstats as there is alot more that can be done. The above is to get
you going and may be enough for most people.
Back to Download and install
ActivePerl | Forward to Protect your
Site Stats! ![]()


