For those of you who like Awstats, database is now available for free as GeoLite City. has been available for free as an alternative to the GeoIP::Free module that Awstats uses by default in Cpanel. Since the latest EDGE updates, the GeoIP::Free module has been throwing errors.
Use of uninitialized value in pattern match (m//) at /usr/lib/perl5/site_perl/5.8.8/Geo/IPfree.pm line 81.
Create/Update database for config "/home/USERNAME/tmp/awstats/awstats.DOMAIN.com.conf" by AWStats version 6.9 (build 1.925)
– which is to downgrade to the older version. I decided I would try something new. Besides adding the by city information, the country database is much more up to date and new updates are available monthly from Maxmind as well as an API to use the databases. You can find all kinds of methods to make use of these from their .
- Installing Maxmind GeoIPCountry & GeoIPCity on your Cpanel server:
- Install the (comes with the country database)
- Install the (Pureperl if you cannot do step 1)
- Download the binary format . gunzip the .dat file and copy to /usr/local/share/GeoIP/, which is where the Country database will be if you performed step 1.
For Cpanel users, you must run this command: cp /usr/local/cpanel/src/3rdparty/gpl/awstats-6.9/wwwroot/cgi-bin/plugins/geoip_city_maxmind.pm /usr/local/cpanel/3rdparty/bin/plugins/geoip_city_maxmind.pm This will make the module available for use by Awstats.
For new accounts an Awstats configuration file is generated. To add Country and now City statistics in all new sites, edit /usr/local/cpanel/etc/awstats.conf. I’m not sure if cpup will overwrite this file, but it is possible.
You can comment out LoadPlugin="geoipfree"< so the end of the file looks like this:
#LoadPlugin="geoipfree"
LoadPlugin="geoip GEOIP_STANDARD /usr/local/share/GeoIP/GeoIP.dat"
LoadPlugin="geoip_city_maxmind GEOIP_STANDARD /usr/local/share/GeoIP/GeoLiteCity.dat"
In order to add this to any exsting sites with Awstats, you’ll need to edit the /homedir/username/tmp/awstats.domain.com.conf file and change the end. Make sure there that you comment out the old LoadPlugin lines.
Trying it out
If you have in the Web Host Manager (WHM) : Tweak Settings the check box to allow users to update their Awstats, you can try this out. Run tail /usr/local/cpanel/logs/stats_log and watch for any errors from your attempted update. That is if they don’t pop out at your screen.
While I’m at it, I want to say kudos to Maxmind for releasing another free product (though read the licensee) and because it has been a very helpful blog in the past.
Comments 6
Ray / Ray,
I am looking to replace my search professional box on my website with live ad that are Geo targeted.
Could we talk I need to hire an experienced programmer.
Posted 17 Apr 2009 at 7:19 pm ¶If you legitimately need a programmer, what framework are you currently using?
Posted 19 Apr 2009 at 12:57 pm ¶Or they were just looking for a backlink
Just wanted to say thanks for the easy steps to follow. For anyone reading, if they get an error with the cp command (for copying the perl module) do just check what version of awstats is in /usr/local/cpanel/src/3rdparty/gpl/, mine was 6.7 rather than 6.9.
Should /homedir/username/tmp/awstats.domain.com.conf not read /homedir/username/tmp/awstats/awstats.domain.com.conf?
Anyway, don't want to be a pedant! Thanks!
Posted 15 Sep 2009 at 5:34 pm ¶I was running the edge build at the time. Maybe the awstats version was updated? Thanks for not being a spam-bot
Posted 16 Sep 2009 at 2:51 am ¶I stick with the stable tree, so that would probably explain it. Who says I'm not a spam bot? ;D (The fact I didn't put a website probably gives me away =[ )
One other thing I realised, you should consider making the title less obscure. I Google'd "cpanel awstats geoip cities" and despite you being the first result, the limited synopsis in the results make it sound like you're just blogging that the database is now free, not a super-cool way of adding the functionality into cPanel
Posted 16 Sep 2009 at 3:22 pm ¶That's the problem with having so many blogs to write for. When I get a chance to write for my own, I don't think about its indexing
haha.
Posted 23 Sep 2009 at 3:33 am ¶Post a Comment