Smartlab Software logo

AWStats: Create Traffic Report

AWStats logo Create a traffic report from the AWStats database.


  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. Analyze the traffic page
  9. Tasks

Extending AWStats

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


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

Generate Traffic Reports

Some traffic reports, such as the online today one, are cumulative. Every time the today report is updated, the new information is added on with the old in the AWStats database (in the statsdata directory). So this means when you look at today you may be looking at several days worth of information.

our case - offline

We use to create all our reports. You can see the command line options in the relevant batch files in the mytools directory.

our case - online

For the today we use to generate today's traffic report and need to update manually using the Update now link.


The report generation is explained in further detail.

from the command line

There are two methods to generate reports. Either by using directly or by using a helper script, named

To generate the main report for July 2008 using, you can issue the following command:

 perl LOCALPATH/awstats/wwwroot/cgi-bin/ -config=mysite -month=07 -year=2008 -output -staticlinks > LOCALPATH/monthly/awstats.mysite.200807.html

If the options -month and -year are omitted, then the report is generated for the current month. You can also generate a report for a whole year, by setting these two options to -month=all and -year=2008.

You can view the page with your web browser at:

Furthermore, you can create supplemental reports (lengthy lists of referrers, countries etc.) or even apply filters. This info is covered in detail in the awstats documentation. See the relevant section here.

A quick way to create full reports (main and supplemental pages) is to use the helper script, This can be used in the following way (example from monthly batch file):

perl "LOCALPATH\wwwroot\cgi-bin\" -config=07.2008 -update -month=07 -year=2008 -awstatsprog="LOCALPATH\wwwroot\cgi-bin\" -dir="LOCALPATH\monthly"

All the reports are generated in the monthly directory with awstats.07.2008.html as the main page.

Here is an explanation for some of the options:
-configdir: Sets the path of the directory which contains the configuration files.
-awstatsprog: Sets the path to the script.
-dir: Sets the directory where the report files should be saved.
-builddate: Adds month and year info in the report’s filename.

Again, if the options -month and -year are omitted, then the report is generated for the current month and year.

Other options that can be used are:
-update: Updates the awstats statistics database before generating any reports.
-buildpdf: Creates a PDF file, after the generation of the HTML pages is done.

In order to generate PDF files, the package htmldoc needs to be installed in the system.

from a browser

Enter the path to the online script and the appropriate name of the config file:

This will bring up the AWStats screen. All the information shown is gathered from the AWStats database as specified in the config file.

Next: Analyze traffic report