Remember that everybody else can also see your stats, unless you prohibit in the htaccess file for example. 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. 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. Now we need to install the GeoIP perl module. You will need to create a configuration file for each website for which you wish to view statistics. For CentOS8: dnf install epel-release dnf install awstats Set up AWStats Config. Locate those lines and make the looks like the above ones. For Ubuntu/Debian: apt install awstats -y. ![]() 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |