
AWStats is a powerful tool for website traffic analysis and reporting, helping you make sense of your website's visitor data. It's a free, open-source software that can be installed on your server or used through a web interface.
AWStats can process log files from various web servers, including Apache, IIS, and Nginx, making it a versatile choice for website owners. By analyzing these log files, AWStats provides detailed reports on website traffic, including visitor demographics, browsing behavior, and more.
AWStats is particularly useful for tracking website traffic over time, allowing you to identify trends and patterns in your visitor data. This can help you refine your marketing strategies and improve user engagement on your website.
Consider reading: Anonymous Website Visitor Tracking
Installation
AWStats is a Perl script program, which means it requires a Perl interpreter to run. You can place both the Perl interpreter and AWStats anywhere you like.
AWStats can be run directly from the command line, making it easy to add to Windows Task Scheduler. However, to use it, you need to know the locations of the Perl interpreter, the AWStats script, and its ancillary files.
You can also run AWStats as a CGI program from the browser, but be aware that this method is not recommended if you don't want to make changes to Apache's configuration files.
Here are the basic steps to get started with AWStats:
- Acquire AWStats, other programs, and pertinent information
- Install AWStats on your computer
Optional packages for installing and running AWStats on your computer include cron, which runs periodic scripts (available in the Business package and above).
Files
The AWStats package includes several files, but it's worth noting that the exact list of files may have changed over time.
The distribution of AWStats package includes the following files: AWStats was written in 2000, and I use v7.9 which was published in January 2023.
Newer file types have been added to the AWStats configuration, including webp, webm, and svg files.
Installation
AWStats is a Perl script program that needs a Perl interpreter to run. You can place both anywhere you like.
To use AWStats, you need to know the locations of the Perl interpreter, the AWStats script, and its ancillary files. This can be a bit tricky, but it's a good opportunity to get familiar with your system's file structure.

AWStats can be run directly from the command line, which makes it easy to add to Windows Task Scheduler. I've found this feature to be super helpful for automating tasks.
If you want to run AWStats as a CGI program from the browser, you'll need to make changes to Apache's configuration files. However, I'm avoiding this approach for now.
Here are the steps to acquire the necessary programs and information:
- Acquire AWStats, other programs, and pertinent information
- Install AWStats on the 1and1 shared server
- Install AWStats on your computer
- Set up the AWStats config file
- Create a usable log file
- Create/update the AWStats database
- Create a traffic web page
- Create report batch files
- Analyze the traffic page
- Tasks
Configuration
The configuration of AWStats is a crucial step in getting the tool up and running. You'll need to create a personal configuration file, which is done by copying the example configuration file, awstats.model.conf, and naming it something like awstats.brisray.conf.
To set up your configuration file, you'll need to make a few changes. The LogFile line should be commented out, as you can specify the log files on the command line instead.
You'll also need to update the DirIcons line to point to the relative path where your output HTML files will be stored. In the example, this is set to DirIcons="../icon". Additionally, you'll need to specify the location where you want to store the processed data files, which is done by updating the DirData line. In the example, this is set to DirData="C:/Apache24/awstats/data/brisray".
The TrapInfosForHTTPErrorCodes line should also be updated to specify which HTTP error codes you want AWStats to report on. In the example, this is set to TrapInfosForHTTPErrorCodes="206 400 401 403 404 405 500".
Take a look at this: How to Set up Google Analytics for Website
Organization
Organization is key to keeping your AWStats files in order. I created a new folder named 'data' in the main AWStats folder to store processed history files.
To keep the number of files manageable, I created a folder for each year and inside that, one for each month. This makes it easy to navigate and find specific statistics.
The only folder needed from the AWStats directory is the 'icon' one from the wwwroot folder. This folder contains the necessary files for the AWStats icon to appear in the website's navigation.
By organizing your AWStats folders in this way, you can easily access the statistics you need and keep your files private if desired. I created a new folder named 'aswlogs' in the utils folder on the website to store the statistics.
A fresh viewpoint: New Relic Session Replay
One Config File
One Config File can be a convenient option, but it's not always the best approach. Unfortunately, AWStats expects directives to be in configuration files, not on the command line.
You can't just use one config file for multiple virtual hosts. AWStats will give you an error message if you try, saying "Error: SiteDomain parameter not defined in your config/domain file. You must edit it for using this version of AWStats."
Dropdowns

Dropdowns can be a bit tricky to get working with AWStats, but it's worth the effort.
AWStats can make dropdowns on the pages it produces to navigate between month and year reports.
This only works properly if the reports are produced as a CGI, not as static pages.
To get this working, you'll need to use the following command: perl awstats.pl -config=mysite -output=downloads -staticlinks > awstats.mysite.downloads.html.
Gzip
Gzip is a useful tool for uncompressing log files locally, which is a requirement for the AWStats Perl scripts to function properly.
You can use gzip to uncompress log files, and it's available for download from sourceforge.
See what others are reading: Web Log Analysis Software
Troubleshooting
If your stats have not updated in over 36 hours, you can manually run them from cPanel. This is because vital processes for keeping your website up have a higher priority than statistic processing.
AWStats can sometimes have trouble creating reports from old log files, especially if they're corrupt. In fact, AWStats did very well to get anything at all from old files dating from 2011.
Manually updating your Awstats through cPanel can be done by following these steps:
- Manually updating your Awstats through cPanel
Multiple Log Files
AWstats can be a bit finicky when it comes to multiple log files. It's designed to read Apache's log files before they're rotated or split, but if you have already split your files by year and month, you're out of luck.
You can't process multiple log files sequentially with AWstats, instead you need to concatenate them into a single large file. AWstats comes with a utility called logresolvemerge.pl to do this, but it might be easier and quicker to write a batch or PowerShell script to process the log files one at a time.
The documentation also mentions using the awstats_buildstaticpages tool to build all pages in one command, but this only works if you run it as a CGI. I've tried it before and got the message that it couldn't find the configuration in the Apache configuration files.
Troubleshooting
Troubleshooting is a crucial part of any web analytics tool's life cycle. If your stats have not updated in over 36 hours, you can manually run them from cPanel. This is a vital process for keeping your website up and running smoothly.
AWStats can be finicky about the state of your log files, so make sure they're not corrupt before trying to run reports. In fact, AWStats did very well to get anything at all from some old log files that were corrupt in some way.
If you're having trouble getting AWStats to work, try enabling debugging to see what's going on. This is a two-step process: change the configuration file line from `DebugMessages=0` to `DebugMessages=1`, and then specify the debug level (1-5) on the command line.
Here are some common issues that can be solved with debugging:
- AWStats reading the log file but not writing the HTML files to display on the website
- Missing "=" sign between a directive and its value
- Messed up output file name on the command line
To manually run AWStats from cPanel, follow these steps:
- Check the AWStats logs to see if there are any error messages
- Try running AWStats with the `-debug` option to see if it provides any clues
- Check the configuration file to make sure it's set up correctly
By following these steps, you should be able to troubleshoot and fix any issues with AWStats.
Frequently Asked Questions
Is AWStats free?
Yes, AWStats is completely free to use. It's distributed under the GNU General Public License, making it open-source and available to everyone.
How reliable is AWStats?
AwStats is generally reliable, but it's not 100% accurate in identifying and excluding non-human visits, such as robot and spider activity
What is a unique visitor in AWStats?
A unique visitor in AWStats is a single person or computer that has accessed your website at least once during the reported period. This count excludes repeat visits from the same user, only counting each individual once.
Featured Images: pexels.com