Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    442

    Default awstats and country detection

    The default awstats "geoipfree" plugin does a really bad job and detecting countries, it produces horrible results.

    Are there any step-by-step instructions on how to replace this with something that actually works and gives correct country information? (something that doesn't require subscription)

    Thank you.

  2. #2
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    442

    Default

    Here is how to make AWSTATS produce proper Country and City statistics:

    1) download the following two files:
    http://geolite.maxmind.com/download/...y/GeoIP.dat.gz
    http://geolite.maxmind.com/download/...iteCity.dat.gz

    2) gunzip them under /usr/local/lib/ (easily accessible from cPanel and awstats)

    3) Make sure you have the perl module "Geo::IP::PurePerl" installed. Go to WHM->Install a Perl Script and install it if you don't.

    4) Edit /usr/local/cpanel/etc/awstats.conf and at the bottom REMOVE the geoipfree plugin and add the following:

    Code:
    #LoadPlugin="geoipfree" (disabled, so we can use geoip with database)
    LoadPlugin="geoip GEOIP_STANDARD /usr/local/lib/GeoIP.dat"
    
    # You need the "geoip_city_maxmind" which is not included by default in cPanel
    #LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/lib/GeoLiteCity.dat"
    Finally, proper statistics!!!
    Last edited by sehh; 02-01-2009 at 04:50 AM.

  3. #3
    Member
    Join Date
    Apr 2007
    Location
    Bakersfield, California
    Posts
    270

    Default

    Quote Originally Posted by sehh View Post
    Here is how to make AWSTATS produce proper Country and City statistics:

    1) download the following two files:
    http://geolite.maxmind.com/download/...y/GeoIP.dat.gz
    http://geolite.maxmind.com/download/...iteCity.dat.gz

    2) gunzip them under /usr/local/lib/ (easily accessible from cPanel and awstats)

    3) Make sure you have the perl module "Geo::IP::PurePerl" installed. Go to WHM->Install a Perl Script and install it if you don't.

    4) Edit /usr/local/cpanel/etc/awstats.conf and at the bottom REMOVE the geoipfree plugin and add the following:

    Code:
    #LoadPlugin="geoipfree" (disabled, so we can use geoip with database)
    LoadPlugin="geoip GEOIP_STANDARD /usr/local/lib/GeoIP.dat"
    
    # You need the "geoip_city_maxmind" which is not included by default in cPanel
    #LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/lib/GeoLiteCity.dat"
    Finally, proper statistics!!!
    Nice info. I've never had anyone complain about stats, but I'll do this just to get an improvement. Question, is it worth installing the "geoip_city_maxmind" (guessing it needs to be installed manually since it's commented out above?) ?

  4. #4
    Member sehh's Avatar
    Join Date
    Feb 2006
    Location
    Europe
    Posts
    442

    Default

    You won't get complaints if your users are US-based, because the default geoipfree just dumps everyone it doesn't understand as a US connection. Everyone else will complain that their users are 90% from Spain, while awstats reports that they come from the US.

    Can't say if its worth it, maybe for US-based websites since thats the most detailed information that the database has at the moment.

Similar Threads & Tags
Similar threads

  1. blacklist by country IP range
    By abubin in forum New User Questions
    Replies: 2
    Last Post: 10-17-2005, 05:40 AM
  2. Webalizer and country
    By Jontxu40 in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 12-08-2004, 02:58 AM
  3. How to block certain country from a server
    By mark1hos in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-28-2004, 08:33 PM
  4. Webalizer - usage by country
    By DN-Paul in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-17-2004, 09:52 AM
  5. AWStats country statistics
    By rhood in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 02-20-2003, 10:40 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube