Skip to content

Instantly share code, notes, and snippets.

@plasticbrain
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plasticbrain/9065764 to your computer and use it in GitHub Desktop.
Save plasticbrain/9065764 to your computer and use it in GitHub Desktop.
Installing IP2Location c library and apache module
$ sudo apt-get install autoconf gcc build-essential apache2-prefork-dev apache2-threaded-dev libtool
$ wget http://www.ip2location.com/downloads/ip2location-apache-5.0.0.tar.gz
$ tar xvfz ip2location-apache-5.0.0.tar.gz
$ wget http://www.ip2location.com/downloads/ip2location-c-6.0.2.tar.gz
$ tar xvfz ip2location-c-6.0.2.tar.gz
$ cd ip2location-c-6.0.2/
$ autoreconf -i -v --force
$ make
$ make install
$ cd ip2location-apache-5.0.0/
$ apxs2 -i -a -L /usr/local/bin/ -I ../ip2location-c-6.0.2/libIP2Location/ -l IP2Location -c mod_ip2location.c
$ sudo nano /etc/apache2/apache2.conf
<IfModule mod_ip2location.c>
IP2LocationEnable On
IP2LocationSetmode ALL
IP2LocationDBFile /var/IP-COUNTRY-REGION-CITY.BIN
</IfModule>
$ sudo service apache reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment