How to Enable GeoIP Plugin for Awstats in Plesk

By default, Awstats doesn’t show countries visitors are visiting from, but there is a plugin called GeoIP could do it. In this tutorial, I will show you how to enable GeoIP plugin for Awstats in Plesk control panel. If you are not using Plesk, it’s OK, the steps are more or less the same, the only difference is you have to setup a cron job instead of adding a scheduled task. Scheduled tasks, which was a component of Plesk control panel, is a GUI tool for web masters to manage cron job easily and flexibly.

Preinstalling

First, install required perl modules (Geo::IP), take CentOS for example.

yum install GeoIP GeoIP-data GeoIP-devel

Second, download GeoIP database, and store it in local directory (you can store in any directory as you want).

cd /var/www/vhosts/yeool.com/geoip/
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gzip -d GeoLiteCity.dat.gz

Edit Awstats Configuration Files

The main configuration files are /etc/awstats/awstats.comf and /etc/awstats/awstats.model.conf, all the changes you made will only be effected to the new websites. If you have websites which had awstats enabled, you can find configuration files for existing websites in /usr/local/psa/etc/awstats/.

Enable GeoIP by uncommenting a line looks like LoadPlugin=”geoip GEOIP_STANDARD /pathto/GeoIP.dat” in the configuration file, place “/pathto/GeoIP.dat” with the your own path where you stored the GeoIP you downloaded in previous. The following line is what I configured in my awstats configuration file.

LoadPlugin="geoip GEOIP_STANDARD /var/www/vhosts/yeool.com/geoip/GeoIP.dat"

Update awstats and you can see the countries information your visitors are visiting from. By default, Awstats will be updated everyday, if you want to update Awstats in real-time, just add a scheduled task.

Leave a Reply

Your email address will not be published. Required fields are marked *