How to Install AWStats on macOS

Introduction

AWStats is a free and open-source log analyzer which generates advanced web, streaming, ftp or mail server statistics, graphically. It supports multiple platforms including macOS. This tutorial will guide you through the installation process of AWStats on macOS.

Prerequisites

Before you start with the installation of AWStats, make sure that you have the following prerequisites installed on your macOS system:

Step-by-Step Guide

Here are the steps to install AWStats on macOS:

  1. Download the latest version of AWStats from the official website https://sourceforge.net/projects/awstats/files/
  2. Extract the downloaded archive to a location on your Mac.
  3. Rename the extracted directory to "awstats".
  4. Open the Terminal app on your Mac.
  5. Navigate to the "awstats" directory using the command "cd /path/to/awstats".
  6. Run the config file using the command "./configure.pl".
  7. Enter the details as per your requirement when prompted. These can be W3C log format, log file path, domain name, and so on.
  8. After you've entered all the required information, save the changes and exit the config file.
  9. Run the following command to generate statistics reports: "./awstats.pl -config=yourconfig -update".
  10. Your AWStats reports should now be located in the "/awstats/yourconfig/" directory.

Configuring AWStats with Apache

To make AWStats accessible through a web browser, you will need to configure Apache. Here are the steps:

  1. Open the Terminal app on your Mac.
  2. Navigate to the Apache configuration directory using the command "cd /etc/apache2".
  3. Open the Apache configuration file using the command: "sudo nano httpd.conf"
  4. Add the following lines at the bottom of the configuration file:
# AWStats configuration
Alias /awstatsclasses "/path/to/awstats/wwwroot/classes/"
Alias /awstatscss "/path/to/awstats/wwwroot/css/"
Alias /awstatsicons "/path/to/awstats/wwwroot/icon/"

ScriptAlias /awstats/ "/path/to/awstats/cgi-bin/"

<Directory "/path/to/awstats/cgi-bin/">
    Options ExecCGI
    SetHandler cgi-script
    Order allow,deny
    Allow from all
</Directory>

Remember to replace /path/to/awstats with the actual path to the AWStats directory on your Mac.

  1. Save the changes and exit the configuration file.
  2. Restart Apache to apply the changes using the command: "sudo apachectl restart".

Conclusion

You have successfully installed and configured AWStats on your macOS system. You can now generate reports on your web traffic by accessing AWStats through a web browser. This free and open-source tool will help you analyse your server logs and gain valuable insights on your website's performance.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!