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.
sudo
sudo apt-get update
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
.
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.
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
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
Save and exit the file by pressing Ctrl+X
, then Y
for yes and Enter
to confirm.
Restart the Apache web server to make the changes take effect:
sudo systemctl restart apache2
sudo nano /etc/awstats/awstats.conf
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.
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.
Save and exit the file by pressing Ctrl+X
, then Y
for yes and Enter
to confirm.
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.
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.
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!