First off, I am using XAMPP 1.4.9:
ApacheFriends XAMPP (basic package) version 1.4.9 (win32)
+ Apache 2.0.52
+ MySQL 4.0.21
+ PHP 5.0.2 + PHP 4.3.9 + PEAR
+ PHP-Switch win32 1.0 (by Apachefriends, use the "php-switch.bat")
+ MiniPerl 5.8.3
+ SQLite 2.8.15
+ PHPMyAdmin 2.6.0 pl1
+ ADODB 4.52
+ Mercury Mail Transport System for Win32 and NetWare Systems v4.01a
+ FileZilla FTP Server 0.9.3
+ Webalizer 2.01-10
+ Zend Optimizer 2.5.3
PERL Installation
The first thing you need to do to get ready to install AWStats is to realize that the version of PERL that comes with XAMPP (MiniPerl) is just that MINI. It is missing several libraries that AWStats needs to function.
So head over to ActiveState.com and download ActivePerl.
Once you have got it, go to your XAMPP install directory, delete or rename the perl folder. You will be replacing that PERL with this new one.
Now run the install for ActivePerl and install to XAMPP\perl
Now there should be an exe on this path after installation: XAMPP\perl\bin\perl.exe - if that is not true, try again.
AWStats Installation
Now, you are ready to start installing AWStats. Head over to their site and get the latest download. I used 6.2 - Just get the zip file.
Extract that and open the awstats folder. Open the wwwroot folder.
Copy the icon, css, and js folders into XAMPP\htdocs thus placing them in the webroot.
Now, go into XAMPP\cgi-bin\ and create a folder called awstats. Copy all the files from AWSTATS-ZIPFILE\wwwroot\cgi-bin into the folder you just made.
A Note Before We Continue
It is at this point in the tutorial that things are going to get different for each installation of XAMPP because we need to start using absolute paths. For my system, the absolute path to the XAMPP install is:
- Code: Select all
C:\xampp\
So, if I say XAMPP_PATH, that is what I am referring to.
AWStats Configuration
Go into XAMPP\cgi-bin\awstats and rename awstats.model.conf to awstats.conf. Open the file.
In the file there are several important lines that you need to change:
1) Line 51.
- Code: Select all
LogFile="/var/log/httpd/mylog.log"
Change this line to the
- Code: Select all
XAMPP_PATH\apache\logs\access.log
2) Line 117.
- Code: Select all
LogFormat=1
Change that to
- Code: Select all
LogFormat=4
3) Line 206
- Code: Select all
DirCgi="/cgi-bin"
Change to
- Code: Select all
DirCgi="/cgi-bin/awstats"
Other lines of interest (Read their info):
Line 147
Line 162
Line 233
Running AWStats
The best way to run AWStats and update your stats is via a command prompt, or a bat file once you've gotten the hang of it.
Open the "Start" menu -> "Run..." -> "cmd.exe"
Then run
- Code: Select all
XAMPP_PATH\perl\bin\perl.exe XAMPP_PATH\cgi-bin\awstats.pl -config=WWW_YOURHOST_COM -update
The first time you run this will take a very long time if you have a large log file to be parsed. Mine took ages (but my computer is a pile of old junk, and the log file was three months long)
Other Options
At this point you'll want to begin investigation other options for AWStats as it has many powerful features:
Update Via Browser
Referrer Tracking
Search Engine Query Tracking
User Tracking (Screen size, plugin availability, etc)
And other great stuff...
But most of it falls outside of the scope of what I am trying to get set up here - AWStats functioning.
One Last Thing
I do, however, highly reccommend that you change the APACHE log format. The default in XAMPP is leaving out important information such as referrer and user agent.
1) Open XAMPP\apache\conf\httpd.conf find the string
- Code: Select all
#CustomLog logs/access.log combined
- Code: Select all
CustomLog logs/access-full-clf.log combined
2) Restart the apache server (XAMPP_Stop, XAMPP_Start)
3) Change the awstats.conf to point at the new access log and change the "LogFormat" back to '1'
You wont have access statistics for the previous log files, but the new ones will be much more useful and complete.