How to install AWStats on Ubuntu Server Latest

Introduction

AWStats is a powerful log file analyzer that generates advanced web, streaming, FTP or mail server statistics graphically. It can display static web pages or generate dynamic pages with Javascript, and has per-user or per-IP address reports. The installation process in Ubuntu Server Latest is straightforward, and this tutorial will guide you through the steps.

Prerequisites

Step 1: Install AWStats

  1. Open the terminal on your Ubuntu Server, and update your package list by running the following command:
sudo apt-get update
  1. Install AWStats by running:
sudo apt-get install awstats

During the installation process, you will be prompted to set up your mail server. The default option should work, so you can press Enter.

  1. Once the installation is complete, you need to configure AWStats to analyze the log files of the web server you want to monitor. In this example, we will configure it to analyze the Apache web server log files.

  2. Open the configuration file for Apache's log files using your favorite text editor. In this example, we'll use nano:

sudo nano /etc/apache2/conf-available/other-vhosts-access-log.conf
  1. Scroll down to the line that reads CustomLog and add the following two lines immediately above it:
# AWStats configuration
Alias /awstatsclasses "/usr/share/awstats/lib/"
Alias /awstats-icon "/usr/share/awstats/icon/"
Alias /awstatscss "/usr/share/doc/awstats/examples/css"
ScriptAlias /awstats/ "/usr/lib/cgi-bin/"
Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
  1. Save and exit the file by pressing Ctrl+X, then Y for yes and Enter to confirm.

  2. Restart the Apache web server to make the changes take effect:

sudo systemctl restart apache2

Step 2: Configure AWStats

  1. Open the configuration file for AWStats by running:
sudo nano /etc/awstats/awstats.conf
  1. Scroll down to the SiteDomain option and enter the domain name of the website you want to monitor:
SiteDomain="example.com"

Replace example.com with the actual domain name of your website.

  1. Scroll down to the LogFile option and enter the path to the Apache log file:
LogFile="/var/log/apache2/access.log"

Replace /var/log/apache2/access.log with the path to the Apache log file on your server.

  1. Save and exit the file by pressing Ctrl+X, then Y for yes and Enter to confirm.

  2. Generate the initial statistics for your website by running:

sudo /usr/lib/cgi-bin/awstats.pl -config=example.com -update

Replace example.com with the name of the configuration file you just edited.

Step 3: Access AWStats

  1. Open a web browser on your local machine and navigate to http://your-server-ip/awstats/awstats.pl?config=example.com.

Replace your-server-ip with the IP address or domain name of your server, and example.com with the name of the configuration file you just edited.

  1. You should now see the AWStats web interface. Explore the different features to view your website's statistics.

Conclusion

You have successfully installed and configured AWStats on your Ubuntu Server Latest. You can now use it to generate advanced statistics for your website.

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!