Search This Blog

Tuesday, September 4, 2012

Install Geo::IP Perl Module on Debian | MDLog:/sysadmin

Install Geo::IP Perl Module on Debian | MDLog:/sysadmin: "perl Makefile.PL"


Install Geo::IP Perl Module on Debian

This little post will guide you how to quickly install the MaxMind Geo::IP Perl Module that has different usages as shown in other posts. This module should be faster than the otherMaxMind perl module (Geo::IP::PurePerl) but it will require to have the GeoIP C libraryinstalled in order to be compiled.
So first we will need to install the GeoIP C library (that includes also the free GeoLite Country database). Luckily this is available in the Debian repositories so we can simply install it using:
apt-get install libgeoip1 libgeoip-dev
Next, to install the GeoIP perl module, we need to download the perl module locally fromMaxMind or from CPAN.
The latest version available at the time I wrote this post is Geo-IP-1.27, but you should get the latest version available. Uncompress it and compile it as any perl module:
perl Makefile.PL
make
make test
make install
For other Linux distributions you will have to use the same steps (first install the GeoIP C library and then download and compile the perl module).
Note: if you are using Centos4 then you can skip all these steps as they have packaged the perl module in the “extras” repository so you can install it by simply running:
up2date perl-Geo-IP



On Ubuntu 8 you can also install the GeoIP perl library from a package repository:
apt-get install libgeo-ip-perl

No comments:

Post a Comment