How do I configure AWStats to show the country of site visitors?
Overview
By default, AWStats does not show the source country for visitors viewing a domain.
Requirements
Before you start, this article has the following dependencies:
- You must have SSH access set up for root or a sudo user.
READ ME FIRST
This article is provided as a courtesy. Installing, configuring, and troubleshooting third-party applications is outside the scope of support provided by (mt) Media Temple. Please take a moment to review the Statement of Support.
Instructions
To enable this feature, the GeoIP plugin will need to be configured. Information about this plugin from /etc/awstats/awstats.conf:
# Plugin: GeoIP
# Perl modules required: Geo::IP or Geo::IP::PurePerl (from Maxmind)
# Country chart is built from an Internet IP-Country database.
# This plugin is useless for intranet only log files.
# Note: You must choose between using this plugin (need Perl Geo::IP module
# from Maxmind, database more up to date) or the GeoIPfree plugin (need
# Perl Geo::IPfree module, database less up to date).
# This plugin reduces AWStats speed of 8% !
Usually, geoip.pm plugin comes with AWStats package. However, the Perl modules necessary for the plugin to work (Geo::IP or Geo::IP::PurePerl) must be installed. You can get all the necessary installation instructions and downloadable plugin files (for example, "Geo::IP::PurePerl Module" library) from here:
- http://awstats.sourceforge.net/docs/awstats_contrib.html#geoip
- http://www.maxmind.com/app/perlrId=awstats
The plugin needs to be enabled in the main AWStats configuration files:
/etc/awstats/awstats.conf
/etc/awstats/awstats.model.conf
You will need to edit the files that were already configured by Plesk for every domain which can be found in /usr/local/psa/etc/awstats/*. The line that should be added into all these files looks like:
LoadPlugin="geoip GEOIP_STANDARD /pathto/GeoIP.dat"
Latest GeoIP.dat can be found at http://www.maxmind.com/download/geoip/database/GeoIP.dat.gz.
NOTE:
It may take a couple of days for your stats to start accumulating the countries information.