Smartlab Software logo

 Install AWStats on your PC

AWStats logo How to install and set up AWStats on your local computer. This is used if you want to do offline processing or you want to archive your reports.

Steps

  1. Acquire AWStats, other programs, and pertinent information
  2. Install AWStats on the 1and1 shared server
  3. Install AWStats on your computer
  4. Set up the AWStats config file
  5. Create a usable log file
  6. Create/update the AWStats database
  7. Create a traffic web page
  8. Create report batch files
  9. Analyze the traffic page
  10. Tasks

Extending AWStats

  1. Extras
  2. Geographic Plug-ins
  3. How To

Help

  1. Glossary
  2. FAQ
  3. Pages not found FAQ
  4. Stop Referrer Spam

Install Perl

Perl defaults to installing in C:\Perl directory. It is best NOT to install Perl in the program files directory if you are using Vista because of security issues.

To see if Perl installed correctly type in  perl -v   at a Windows command prompt. Perl's version, and a few other items of interest, will be displayed.

Install AWStats

Since AWStats version 6.8 is the latest (as of Aug 2008) I will be using it as the example.

1. Install awstats 6.8 to a directory called awstats. I do not install it in Program Files since I'll be doing a lot of manual access to awstats; in fact I have it on my data drive D: so it is included in backup.

The directory structure looks like this:

awstats
   docs
   tools
   wwwroot
     cgi-bin
     classes
     css
     icon
     js

2. In awstats directory create the following additional directories:

  • archive-logs
  • archive-reports
  • daily
  • geodb
  • merge
  • monthly
  • mytools
  • statdata
  • today
  • weekly

3. Copy the following from the tools directory to wwwroot/cgi-bin directory:

  • logresolvemerge.pl
  • awstats_buildstaticpages.pl

4. Copy gzip.exe to mytools directory.

5. From mytools.zip copy the following to mytools directory:

  • make-today-reports.bat
  • make-daily-reports.bat
  • make-weekly-reports.bat
  • make-monthly-reports.bat
  • make-monthly-reports2.bat

Each batch file needs to be edited and have the LOCALPATH set to your awstats directory on your computer. For example:  set LOCALPATH=d:\dev\awstats

4. This is the resulting directory structure, ready for operation:

awstats
   archive-logs
   archive-reports
   daily
   geodb
   docs
   merge
   monthly
   mytools
   statdata
   today
   tools
   weekly
   wwwroot
     cgi-bin
     classes
     css
     icon
     js

Environment Setup

Add a path to your mytools directory in the Window's PATH variable. This is so gzip can be found by AWStats scripts. See the Additional Resources for an easy way to do this.

Tool Usage

  • logresolvemerge.pl - used to merge two or more server log files. Puts them in chronological order
  • awstats_buildstaticpages.pl - builds several ancillary traffic reports such as 404 web page not found.
  • gzip.exe - used to uncompress server logs (ending in gz)

Directory Usage

  • archive-logs - storage of original server logs
  • archive-reports - holds old reports
  • daily - holds day log and associated reports
  • geodb - holds geographic-related databases
  • docs - AWStats documentation
  • merge - holds several server logs for merging
  • monthly - holds monthly reports
  • mytools - collection of tools used to generate reports
  • statdata - AWStat's database
  • today - today's reports and server log (copy)
  • tools - set of AWStat tools
  • weekly - weekly reports and server log (copy)
  • wwwroot - support files for AWStats perl scripts

Install gzip

Copy gzip.exe (in the bin directory) to mytools directory. Nothing else is needed.

Next: Configure AWStats

Related resources

PATH editor - edit Windows' PATH variable