Using the Geo-IP plugin with Awstats in Gentoo Linux

Here’s a summary of what we’re going to do…

  1. emerge Geo-IP
  2. Check that it works using geoiplookup
  3. Edit the awstats config file

1. Emerge Geo-IP

It’s as easy as …

emerge Geo-IP

This will also emerge the geoip package if it is not already installed.

2. Check that it works using geoiplookup

We can check that geoip is working using the geoiplookup command…

geoiplookup www.bbc.co.uk

Should give …

GeoIP Country Edition: GB, United Kingdom

3. Edit the awstats Config File

Edit your awstats config file to activate the Geo-IP plugin. This file is in /etc/awstats/.

vi /etc/awstats/awstats.yourdomain.conf

and add this line

LoadPlugin="geoip GEOIP_STANDARD /usr/share/GeoIP/GeoIP.dat"

You can change the last argument of this command if your GeoIP database is installed in another location.

That’s it! Awstats now shows which country an IP address comes from.

One Response to “Using the Geo-IP plugin with Awstats in Gentoo Linux”

  1. Martin Says:

    Very cool explanation.

    I tried to use maxmind’s Database, installed it on Debian Sarge, here is the result:
    http://ipinfo.eu/geoip/

Leave a Reply