
Setting up and optimizing AWStats PL statistics can seem daunting, but it's actually quite straightforward.
AWStats PL statistics are a powerful tool for tracking website traffic and behavior, providing valuable insights into how users interact with your site.
To get started, you'll need to configure your AWStats settings to collect the right data. This involves specifying the log file locations and setting up the necessary plugins.
With AWStats PL statistics, you can track everything from page views and unique visitors to bounce rates and search engine referrals.
Installation
To install AWStats, you'll first need to install the EPEL repo and enable the ol8_codeready_builder repo.
The AWStats package is not included in the Oracle Linux default repo, so this step is necessary.
Install the AWStats package using the command mentioned in the installation instructions.
Create a Sample Website
To create a sample website, you'll need to create an Apache virtual host configuration file. This file will allow you to specify the settings for your website.
Add the following lines to the configuration file: you will need to create a website that you want to monitor using AWStats.
Install

To install the necessary packages, you'll need to install the EPEL repo and enable the ol8_codeready_builder repo. This is because the AWStats package is not included in the Oracle Linux default repo.
You'll also need to install the AWStats package itself using the command mentioned in the documentation. Don't forget to install the mod_perl package if you're using Apache HTTP Server as your web server.
Configuration
To configure AWStats, you'll need to create a personal configuration file. This file is a copy of the example configuration file awstats.model.conf, which you'll find in the awstats\wwwroot\cgi-bin directory.
Rename this file to awstats.brisray.conf and make a few changes to suit your needs. For instance, you'll need to comment out the LogFile line if you have a large number of old Apache files to process.
You'll also need to specify the relative path to where your output HTML files are stored, as well as the location where you want to keep your processed data files.
Configure

To configure AWStats, you'll need to create a configuration file, which is a copy of the example file provided with the package. Make a copy of the example configuration file, such as awstats.model.conf, and name it something like awstats.yourdomain.conf.
The LogFile line should be commented out, as AWStats will process the log files on the command line instead of from the configuration file.
AWStats expects directives to be in the configuration files, not on the command line, so you can't specify the log file and domain name on the command line.
To create a separate configuration file for your website, create a copy of the main configuration file and edit it to define your Apache server log file and domain name.
Set the LogFile variable in the configuration file to the path where Apache logs accesses in the 'combined' format.
You can use the awstats configuration tool to generate a site configuration file, which will set the LogFile variable correctly.

The DirIcons line should be changed to the relative path to where the output HTML files are, such as DirIcons="../icon".
The DirData line should be changed to where you want the processed data files to be kept, such as DirData="C:/Apache24/awstats/data/brisray".
The TrapInfosForHTTPErrorCodes line should be changed to include the specific HTTP error codes you want to track, such as TrapInfosForHTTPErrorCodes="206 400 401 403 404 405 500".
Make sure the Apache configuration is set to log access logs as 'combined' format, unless you want a different behavior.
Include the AWStats configuration file in the Apache configuration to enable AWStats to read logs and convert them to stats.
Geoip (Optional)
You can add geoip support to your awstats configuration.
To do this, you'll need to install the Geo::IP module using cpan, or install perl-geoip instead.
Alternatively, you can install perl-geoip to enable geoip support.
This will allow you to add geoip data to your awstats site configuration.
If you install geoip-database-extra, you can add additional geoip data to your awstats site configuration.
This includes lines that can be added to your awstats site configuration files located in /etc/awstats/.
Statistics
With AWSTATS, you can view a wealth of information about your website's traffic and behavior.
AWSTATS provides a detailed breakdown of the top 25 pages on your site, giving you insight into which content is most popular with your visitors.
You can also see how long visitors spend on your site, which can help you identify areas for improvement.
AWSTATS shows the number of visitors to your site each month, as well as the number of visitors per day.
This data can be especially useful for planning and optimizing your content.
Here are some key statistics you can view in AWSTATS:
- Top 25 Pages
- Visit Duration
- Number of visitors to your site each month
- Number of visitors to your site per each day in a month
- Number of hits to your site per country
Multiple Log Files
Working with multiple log files can be a challenge, especially when AWstats insists on concatenating them into a single file before processing. This can be time-consuming and inefficient.
AWstats comes with a utility called logresolvemerge.pl to help with this process, but it might be easier to write a batch or PowerShell script to process the log files one at a time.
You can use the awstats_buildstaticpages tool to build all the static pages in one command, but only if you run it as a CGI. Otherwise, you'll get an error message saying it can't find the configuration in the Apache configuration files.
If you have a script that splits your Apache log files into monthly reports, you can use it to your advantage by processing the files one at a time, making the task much quicker and more manageable.
Downloads Report
To generate a complete downloads report, you need to run the command perl awstats.pl -config=mysite -output=alldomains -staticlinks > awstats.mysite.alldomains.html.
This command is essential for making the full list of downloads, which was missing from the Building and reading reports documentation.
Keywords Reports
AWStats can sometimes hang while processing old logs, specifically when producing keywords reports. This issue is not related to the command line used, but rather to the presence of odd characters in the log files.
Processing most log files properly suggests that the problem is isolated to the keywords reports. It's possible that someone entered unusual characters while searching for the site, causing AWStats to choke.
Viewable Information
As you explore your website's statistics, you'll want to know what information you can view. You can see the top 25 pages that visitors are accessing on your site.
With AWSTATS, you can also get a sense of how long visitors are staying on your site - a crucial metric for understanding engagement. The visit duration can give you valuable insights into how to improve your content.
Each month, you can view the number of visitors to your site, which can help you track trends and make informed decisions. You can even break down the number of visitors by day to see which days of the month are most popular.
If you have an international audience, you can also see the number of hits to your site per country, which can help you tailor your content to specific regions.
Frequently Asked Questions
What is the log format for AWStats?
AWStats supports various log formats, including XLF/ELF, CLF, W3C, and custom formats that contain all necessary information. To use AWStats, your web server must be able to write log files in one of these formats.
How to set up AWStats?
To set up AWStats, you'll need to install it on your server and computer, configure the AWStats file, and create a usable log file. Follow these steps to get started and gain valuable insights into your website's traffic and analytics.
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.
Sources
- https://brisray.com/web/awstats.htm
- https://www.layerstack.com/resources/tutorials/How-to-install-and-configure-AWStats-on-Linux-Cloud-Servers
- https://www.inmotionhosting.com/support/website/awstats-statistics-website-traffic/
- https://www.atlantic.net/vps-hosting/how-to-install-awstats-on-oracle-linux-8/
- https://wiki.archlinux.org/title/AWStats
Featured Images: pexels.com