AWStats and WAMP Installation
AWStats can be configured for most any web server, LAMP, WAMP, IIS etc.. If you like you can read my WAMP vs IIS article to better explain WAMP (WampServer). This tutorial really shows how to install and configure the AWStats, and configure it’s directory structure to be in line with WAMP (WampServer). An addition, I have created a couple of scripts to automate AWStats updates and GEO IP updates.
Preword
It’s a good idea to have both Google Analytics and AWStats. Contrary to most analytic blogs, saying that Google Analytics is better than AWStats log analyzer is a misnomer. All fortune 500 sites at minimum run some sort of log analyzer ‘and’ a variant form of Google analytics, custom proprietary application in-house and/or out sourced. There are many variables to describe the difference in both; so many, that you would need to write a 1000+ page white paper document, and this will still not cover all the differences. So to keep it wise and simple; yes, you need to have both. Just a friendly note from Webdevster.com, before installing AWStats, you should have already configured Google Analytics to start recording data.
This tutorial is split into five chronological sections:
Pages
Installing AWStats on WAMP
Auto Update AWStats on WAMP
Create Additional AWStats WAMP Profiles
Install GEO IP on AWStats WAMP
Auto Update GEO IP AWStats WAMP
Help Links to AWStats and WAMP
Installing and Configuring AWStats on WAMP (WampServer)
First and foremost you must have Perl, installed on your WAMP (WampServer). You can follow my tutorial on how to install Perl on WAMP (WampServer).
Step 1:
Test your perl to make sure its installed. In a cmd type:
prompt>perl -vIf you get the version Perl info, then it works and you can proceed to install AWStats on WAMP (WampServer)
Step 2:
Download and install AWStats, select and download the latest version *.exe. Run the installer, click next to, “I Agree”. Next window, select browse, and install it in c:\wamp\bin\AWStats\, which is the default directory for WAMP (WampServer). Where you install it, really makes all the difference on your success of running AWStats without any issues. So, keep close attention to the location of the files. For this, “how to” we’ll use the aforementioned default directory, c:\wamp\bin\AWStats\.
Help Links to AWStats and WAMP
Step 3:
Next, it will run a Perl script to install all the requirements. The cmd window will read, AWStats awstats_configure 1.0…Please, enter full directory path of your Apache web server … Apache Web server path (’none’ to skip): Type in none.
Step 4:
The cmd window will read, Your web server config file(s) could not be found. You will need to setup your seb server manually…Do you want me to build a new AWStats config/profile (required if first install) [y/N] ? Type in y, for yes
Step 5:
IMPORTANT
I am using my site, webdevster.com as an example. You must substitute webdevster.com related entries with your Windows environment
The cmd window will read, Define config file name to create… What is the name of your web site or profile analysis?… Your web site, virtual server or profile name: Here we type in our web site name like so, awstats.webdevster.conf or awstats.webdev.conf; its up to you, how you want to handle your naming conventions. I’ll keep it short.
Step 6:
The cmd window will read, Sorry for Window users, if you want to have statistics to be updated on a regular basis, you have to add the update process in a scheduler task manually… Press Enter to Continue
Step 7:
The cmd window will read, Sorry for Window users, if you want to have statistics to be updated on a regular basis, you have to add the update process in a scheduler task manually… Press Enter to Continue
Another cmd will read, A simple config file has been created: c:/wamp/bin/AWStats\wwwroot\cgi-bin\awstats.awstats.webdev.conf.conf … You can then manually update your statistics for ‘awstats.webdev.conf’ with command:
>perl awstats.pl -update -config=awstats.webdev.conf
You can also build static report pages for ‘awstats.webdev.conf’ with command:
>perl awstats.pl -output=pagetype -config=awstats.webdev.conf
Press Enter to Finish
And close out Installation Complete log.
Step 8:
Depending on your environment, you can choose between two options, as follows:
Option 1. If your web server log files are located on the same machine or local network: Browse to c:/wamp/bin/AWStats and create two additional folders; reports and data. The data folder is to store your AWStats databases for each profile, i.e. awstats.webdev.conf. The reports folder, is to store your generated reports/statistics.
So, it should like this:
c:/wamp/bin/AWStats/reports
c:/wamp/bin/AWStats/data
Option 2: If your logs are located on a remote machine, you can schedule an automatic download of the log files (not covered in the scope of this tutorial) or simply manualy download them to your local computer. Browse to c:/wamp/bin/AWStats and create three folders; logs, reports, and data. You can optionally create subdirectories, like so: logs/webdev/ or reports/webdev. The data folder is to store your AWStats Databases for each profile, i.e. awstats.webdev.conf. The reports folder, is to store your generated reports. And the logs folder, is to store your apache logs.
So, it should like this:
c:/wamp/bin/AWStats/logs
c:/wamp/bin/AWStats/reports
c:/wamp/bin/AWStats/data
Step 9:
Edit your c:/wamp/bin/AWStats/wwwroot/cgi-bin/awstats.awstats.webdev.conf.conf with any simple text editor, such as notepad++, etc.. Do not use Windows Word when editing any plain text config file, as it may save characters which will generate errors.
Depending on your environment, you can choose between two options (local networked server, or local server), as follows:
Option 1. If your webserver log files are in your computer (local server):
- First, we replace this line:
LogFile="/var/log/httpd/mylog.log"
with the location of your wampserver log files. Like so:
LogFile="c:/wamp/logs/webdev/http/access.log"
Option 2: If your logs are located on a local networked server:
- Point the LogFile to your other machine on the local network. Like the following example:
LogFile="\\192.168.100.100\logs\webdev\http\access.log"
Please note, when I first configured WAMP (WampServer), I created this directory structure, so yours will look different. Either way, you need to point it to your log files.
Now we continue with other edits, regardless of the location of the WAMP (WampServer).
- We need to confirm or edit this line:
LogFormat=1
If it’s not set to 1, then set it to 1.
- Find and edit this line:
SiteDomain="awstats.webdev.conf"
to:
SiteDomain="webdevster.com"
- Find and edit this line:
HostAliases="awstats.rpt.conf www.awstats.rpt.conf 127.0.0.1 localhost"
to:
HostAliases="webdevster.com www.webdevster.com 127.0.0.1 localhost"
Please note, if your webserver is located on a another server on your local network make sure you put that ip address here also, for example 192.168.100.100, like so:
HostAliases="webdevster.com www.webdevster.com 127.0.0.1 localhost 192.168.100.100"
- Find and edit this line:
DNSLookup=2
to:
DNSLookup=0
Please note, we set it to zero so we can quickly process the log files the first time. If you really want reverse DNS lookup to resolve with names instead of IP addresses, then enter DNSLookup=1; this feature slows down the process signifacantly. You can enter the default of DNSLookup=2, to lessen the time to process the reverse DNS lookup.
- Find and edit this line:
DirData="."
to:
DirData="c:/wamp/bin/AWStats/data/webdev"
Please note, I created a subdirectory webdev, so we can store webdev related data in here. And so, if you want to add another profile (web site), you would add another folder like so, data/my2ndsite. This is optional as you can keep them all living inside, /data directory.
- Find and edit this line:
DirIcons="/icon"
to:
DirIcons="/awstatsicons"
- Find and edit this line:
SkipHosts=""
to:
SkipHosts="REGEX[^192\.168\.100\.]"
Please note, this will exclude erroneous local network traffic. AWSTats will not processs entire subnet mask of (excludes any IP addresses that start with) 192.168.100.*, if you want to include local traffic than leave it alone like so, SkipHosts=”"
Step 10:
Make a copy of your c:/wamp/bin/AWStats/wwwroot/cgi-bin/awstats.awstats.webdev.conf.conf file in the same directory and name it awstats.webdev.conf.
This awstats.webdev.conf will be your configuration file that awstats loads up. The other awstats.awstats.webdev.conf.conf can be used as a template to create additional profiles, which is also covered in SECTION 3. CREATE ADDITIONAL PROFILES
Step 11.
Process the first log by typing the following cmd.
prompt>perl c:\wamp\bin\AWStats\wwwroot\cgi-bin\awstats.pl -update -config=webdevIt will look similar to this:
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\CJ>perl C:\wamp\bin\AWStats\wwwroot\cgi-bin\awstats.pl -update -config=webdev
Create/Update database for config “C:\wamp\bin\AWStats\wwwroot\cgi-bin/awstats.rpt.conf” by AWStats version 6.
95 (build 1.943)
From data in log file “\\192.168.100.100\www\log\webdev\http\access.log”…
Phase 1 : First bypass old records, searching new record…
Searching new records from beginning of log file…
Phase 2 : Now process new records (Flush history on disk after 20000 hosts)…
Jumped lines in file: 0
Parsed lines in file: 889300
Found 33222 dropped records,
Found 8 corrupted records,
Found 0 old records,
Found 856070 new qualified records.
C:\Documents and Settings\CJ>
Please note, if your apache logs are on a networked server, make sure they are world readable:
The first time you run the update process, it may take a couple of minutes to a few hours, depending on the size of the log, and if you have DNS Lookup enabled
Step 12.
Configure directives.
Create a new text file and name it awstats.conf in c:\wamp\alias\ directory. And copy and paste the following into awstats.conf.
Alias /awstatsclasses "c:/wamp/bin/AWStats/cgi-bin/lib/" Alias /awstatsicons "c:/wamp/bin/AWStats/wwwroot/icon/" Alias /awstatscss "c:/wamp/bin/AWStats/wwwroot/css/" ScriptAlias /awstats_show/ "c:/wamp/bin/AWStats/wwwroot/cgi-bin/" ScriptInterpreterSource registry # To give awstats access to specific IP addresses # replace the lines # # Order Allow,Deny # Allow from all #with # # Order Deny,Allow # Deny from all # Allow from 127.0.0.1 # <Directory "c:/wamp/bin/AWStats/wwwroot/cgi-bin/"> Order Allow,Deny Allow from all </Directory> <Directory "c:/wamp/bin/AWStats/wwwroot/icon/"> Order Allow,Deny Allow from all </Directory>
Alternately you can download this awstats.conf: plain-text or zipped
Step 13.
Restart Apache.
Any of the following will work:
And point your browser to http://127.0.0.1/awstats_show/awstats.pl?config=webdev
or
Point your browser to http://localhost/awstats_show/awstats.pl?config=webdev
or
Point your browser to http://se.rv.er.ip/awstats_show/awstats.pl?config=webdev
or
Point browser to http://yourwebsite.com/awstats_show/awstats.pl?config=webdev
COOL STUFF You can essentially call AWSawstats from any virtual web server name, for example: wearefamily.i.have.all.my.sisters.with.me.com/awstats_show/awstats.pl?config=webdev Simply create a virtual web site like you normally do in your c:/wamp/www/wearefamily.i.have.all.my.brothersandsisters.with.me.com/ This will also add an additional layer of security. An addition you can password protect the directory, like you would normally with any virtual web site.


















" AWStats and WAMP Installation (Windows) "
AWStats and WAMP Installation
I like this one the best 5 pages of how to do this. Never seen a site go that in detail with AWStats and Wamp integration.