# AWSTAT UBUNTU AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. [https://help.ubuntu.com/community/AWStats](https://) ## Installation ```bash sudo apt install awstats ``` ## Configuration ### Copy awstats.conf *(replace "mydomain.ext")* ```bash cp /etc/awstats/awstats.conf /etc/awstats/awstats.mydomain.ext.conf ``` ### Open the file ```bash vim /etc/awstats/awstats.mydomain.ext.conf ``` #### Change the following ```vim LogFile="/var/log/apache2/access.log" SiteDomain="mydomain.ext" HostAliases="localhost 127.0.0.1 HostAliases="localhost 127.0.0.1 mydomain.ext" ``` ### Generate the initials stats ```bash sudo /usr/lib/cgi-bin/awstats.pl -config=mydomain.ext -update ``` ## Apache2 configuration ```bash sudo a2enmod cgi ``` ### Tell Apache where stats are, add this code inside the VirtualHost tag ``` vim /etc/apache2/sites-available/*default* ``` ```vim 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 ``` Reload apache ```bash sudo systemctl reload apache2 ``` ## Go to http://mydomain.ext/awstats/awstats.pl ## Crontab Configuration ```bash crontab -e ``` ### Write the next configuration for update every 3 hours awstats ```vim 0 */3 * * * /usr/lib/cgi-bin/awstats.pl -config=mydomain.ext -update > /dev/null ``` ![](https://i.imgur.com/x4EczH7.png)