![awstats ubuntu awstats ubuntu](https://www.server-world.info/en/Ubuntu_14.04/httpd/img/12.png)
Ubuntu 20.04 LTS Server (in a DigitalOcean droplet).
#AWSTATS UBUNTU SOFTWARE#
We'll go through all those steps in this guide.įor the record, the software versions used as of writing the guide are: Hosting the AWStats web interface behind a HTTP digest password.Making AWStats parse the website logs at a certain interval.Configuring AWStats generally and specifically for the websites to monitor.Installation of AWStats and dependencies.To make AWStats tick, we need to accomplish the following things:
![awstats ubuntu awstats ubuntu](https://www.allerstorfer.at/wp-content/uploads/ubuntu-server-installieren-600x450.png)
AWStats simply parses the web server access logs and is able to derive rather detailed information about unique page visits, referring URLs, search engine terms, visit duration, errors, download sizes and more.
#AWSTATS UBUNTU CODE#
But it is still one of the better free web analytics solutions that works without needing to insert any code on the websites to monitor. Remember that everybody else can also see your stats, unless you prohibit in the htaccess file for example.This is a guide for installing AWStats on an Ubuntu 20.04 server for website analytics of multiple virtual hosts served by Nginx.ĪWStats is a venerable log analyzer going all the way back to year 2000. Options ExecCGI -MultiViews +SymLinksIfOwnerMatch Alias /awstatsclasses "/usr/share/awstats/lib/"Īlias /awstats-icon/ "/usr/share/awstats/icon/"Īlias /awstatscss "/usr/share/doc/awstats/examples/css" These lines goes right before the closing VirtuaHost tag. 0 */6 * * * /usr/lib/cgi-bin/ -config=-update > /dev/nullįinally to be able to see the stats, add these lines for every virtual host you have, probably on each file on /etc/apache2/sites-enabled/ folder. You will need to add that line to the cronjob sudo crontab -eĪnd add this line for, and one per domain. Now that we have all prepared, it is time to run awstats for the first time: sudo /usr/lib/cgi-bin/ -config=-update You will need to make logrotate to rotate those logs. Those lines should go in the /etc/rc.local file. varnishncsa -m "RxHeader:^Host: -a -w /var/log/varnish/-D Run this command, one per virtual server.
![awstats ubuntu awstats ubuntu](https://lh3.ggpht.com/-Er6y8iRsNks/VOYpsznNOpI/AAAAAAAAQiE/Nr6EKCLfCpw/awstats_1_thumb%25255B2%25255D.png)
#AWSTATS UBUNTU HOW TO#
Thanks to my friend Riccardo I know how to split logs. Even though awstats can manage combined logs, it is better if the are splitted in one file per virtual server. Varnish uses an independent daemon to log visits, it is called varnishncsa and it will aggregated by default all hits to any virtual server on the same file.
#AWSTATS UBUNTU INSTALL#
Now we need to install the GeoIP perl module. Locate those lines and make the looks like the above ones. LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat" and Create one configuration file for each of them: sudo cp /etc/awstats/nf /etc/awstats/awstats.And: sudo cp /etc/awstats/nf /etc/awstats/awstats.Now edit each one of them, and change this lines (I will show you only data) LogFile="/var/log/varnish/SiteDomain="HostAliases="localhost 127.0.0.1" I will assume you have two virtual hosts. If you want to log them, and analyze later you will have to make Varnish do the job instead of Apache.Īt the end of this tutorial you will have awstats installed, and analyzing logs for all your virtual hosts.įirst things first, lets install awstats (I will assume you already have Apache and Varnish configured and running) sudo apt-get install awstats If you run Varnish in front of Apache and PHP you will unload Apache a lot, and will improve you server hundreds of times.īut this have another effect, because now varnish is handling the load, Apache does not see the hits to your server, therefore it can not log the visits. Varnish is getting quite popular these days. Varnish logs analized with awstats | Multiple virtual servers