This tutorial is written by TheLinker. A Member of the Aprelium forums.
Original Source: http://home.no/thelinker/abyss/awstats/


Advanced web server statistics with AWStats

12.January.2003

Introduction

Last year I was involved in a project to help out a web administrator analyzing his Apache log files. We ended up using AWStats, a great web server log analyzer, that shows all kind of information from the web server log. AWStats is a perl script and can be run in CGI mode and from command line. Some months after this project, I tested AWStats on the log files generated by Abyss. This worked out great after some minor adjustment to the Abyss configuration... and here is how I did it.


The Installation

This section explains one way of installing AWStats... which worked for me. :)

  1. Download the latest stable version from http://awstats.sourceforge.net/. At this time it is version 5.3.
  2. Make sure you have configured Abyss to run perl script, as described on http://www.aprelium.com/abyssws/perl.html.
  3. Open the Abyss Console and go to Server Configuration > Advanced > Server Parameters. Set Extended Logging Format to Yes. If this is already done, and you are sure the Abyss log only contains data in the extended logging format... skip the next instruction.
  4. Delete your current Abyss log files, as you need to get access information in the extended logging format.

Now it's time to install AWStats. In this tutorial I use c:\awstats as the program directory for AWStats. Unzip the awstats-53.zip archive to your c:\ drive. Rename the directory c:\awstats-5.3 to c:\awstats. If done correctly, you should see 3 directories inside your c:\awstats...: docs, tools and wwwroot. Do the following within your c:\awstats directory...:

  1. Create 1 new directory called data.
  2. Rename the wwwroot directory to www.
  3. Move the contents of the directory c:\awstats\www\cgi-bin\ to the c:\awstats\www\ directory. After this your c:\awstats\www\cgi-bin\ should be empty, and you can delete this directory.

Inside your c:\awstats\www directory, you should see the following directories and files...: icon, lang, lib, plugins, awstats.pl and awstats.model.conf.

Now it's time to make a configuration for your site.


The AWStats Configuration

I am not an expert in all the configuration details on AWStats, so I'll just describe the basics.

Make a copy of the file awstats.model.conf and call it e.g. awstats.mysite.no-ip.com.conf. Change the mysite.no-ip.com part of the filename to what your site name is... e.g. awstats.www.mysite.com.conf. It's just a filename, so don't worry about the site name being registered.

Open the newnamed conf file in your favourite notepad editor. Look for the following sections in the file, and change accordingly:

LogFile=
# Set this to the location of your log file... e.g.
LogFile="C:/Program Files/Abyss Web Server/log/access.log"

LogFormat=1
# Remember we changed the log format for Abyss. This is why.

DirData="C:/awstats/data"
# This is the storage directory for the statistical data.

DirCgi="/awstats"
# We need to make an alias later, in the Abyss configuration.

DirIcons="/awstats/icon"
# A path to the AWStats icons.

SiteDomain=
# Set this to your site name... e.g.
SiteDomain="mysite.no-ip.com"

AllowToUpdateStatsFromBrowser=1
# This makes it possible to update the statistics from the browser. Allowing the stats to be updated from the browser is not a recommended solution. Use instead some scheduling tools and run the script e.g. once a day.

Save the config file, and keep on reading for the final preparation...


The Final Preparation

Now we need to make this perl script accessible from the web. Open the Abyss Console and go to Server Configuration > Advanced > Aliases. Create a new alias, where virtual path is /awstats and real path is c:\awstats\www. It's time to access the statistics for the first time.

Open your web browser and enter: http://mysite.no-ip.com/awstats/awstats.pl?config=mysite.no-ip.com. You must of course enter your site name, and the name of your conf file. In the page being generated, you should see a link called Update now. Click this link to update the statistical data.

If you deleted your current log file, you will not see much data for now. But if your site is frequently visited, you will soon see alot of information about your visitors.

As I wrote earlier, I'm not an expert on AWStats. Read the included documentation and conduct your own experiments with the conf files.


Best of regards...
TheLinker


Valid HTML 4.01!