MaxMind
Support My Account FAQ My Order
Support My Account FAQ My Order

Request Support
Frequently Asked Questions
GeoIP Installation
Linux/Unix APIs
Windows APIs
GeoIP Resources
Web Service Sample Code


GeoIP Resources

This page lists some of the 3rd party resources available to help you integrate GeoIP with your applications. While MaxMind does not endorse any of these pages and the use of the code in them is at your own risk, we think they can help you use our products more effectively.

If any of the links are broken or if you have any to add, please email info@maxmind.com.

Implementation

Basics

Introduction to MaxMind Overview of MaxMind on Linux.com. Goes over installing C API, using mod_geoip w/ Apache, showing IP address of a visitor w/ PHP
Basics of getting it to work PHP
Getting Visitor's Country with PHP using Geo IP
Where are you from? IP Geolocation

Mapping

Putting a visitor on a Google Map w/ PHP
Setting up MaxMind GeoIP Lib to work with Google Maps
GeoIP/Google Maps Mashup

Geotargeting

Geotargeting PHP Script
PHP Geotargeting Techniques
Effective Geotargeting with PHP
Geolocate your visitors with PHP
Ad targeting and Drop-down country selector
Whitelisting countries w/ PHP

Visitor Redirection by Country

PHP - uses 301 redirect

Modules and Plugins

General
Geographic Location Awareness (GLA) module for vBulletin
GeoIP for FormMail


WordPress
Geolocation plugin for WordPress
Visitor Map Generator for WordPress
Free, JavaScript-based, WordPress Geolocation plug-in by Pat Friedl


TWiki
Geolocation plugin for TWiki
Blog post by Peter Thoeny on how to use geolocation in TWiki

Country Blocking

Country Blocking

Spam Filter

Installing Milter-Greylist with GeoIP to control spam "The Milter-Greylist is a milter to sendmail written in C that implements the greylist filtering system, as proposed by Evan Harris."

Web Services

GeoIP Web Service Tutorial Uses Java API
Creating your own web service
GeoIP TinyAPI Web Service

GSLB (Global Server Load Balancing)

Layman's Guide to GSLB

BIND GeoIP A new patch for BIND which extends support to additional MaxMind databases, including GeoIP City and IPv6 GeoIP Country. Both threaded and non-threaded operation have been tested. >100B production queries have passed through this patch with neither crashes nor leaks.

GeoDNS Patch for BIND DNS server If you have a server in the US and another in Australia for xyz.com, this patch allows you to direct traffic to the nearest one not just by individual IP addresses, but rather by country. E.g., rather than having to list every IP you want redirected, you can just say, all of US, CA. MX ... go to server1 and all of AU, CN, PK, .... go to server2, etc.

HOWTO Implement GeoDNS using BIND & MaxMind A BASH script that allows the creation of a GeoIP.acl include file for BIND, that can be slotted straight into BIND's configuration file, without the need to patch BIND at all.

GDNSD an authoritative-only DNS server

LAMP

Blake's CentOS LAMP Server Guide sections on AWStats and mod_geoip2

Flash

Note: we have a crossdomain file at http://j.maxmind.com/crossdomain.xml

GeoIP Stream Locking Module for Wowza Wowza is a Flash media server
Getting Your Geospatial Freak-on with MaxMind ActionScript wrapper for our Javascript City Web Service

Facebook

Facebook acts as a proxy between an FBML application and the end user. This "patch" modifies our mod_geoip API so that it receives the user's IP rather than Facebook's.

French: Géolocaliser un utilisateur Facebook depuis PHP via mod_geoip de MaxMind
English: Geotag a Facebook user via PHP mod_geoip of MaxMind

API Resources

C

Installing C or Perl API on any shared host

PHP

GeoIP functions overview
PEAR Library ports MaxMind PHP API to PHP5 and PEAR Standards
Using PHP + GeoLite City to detect the location of someone's IP Portuguese Enlgish

CakePHP

CakePHP is a web framework for PHP similar in concept to Ruby on Rails.

Quickly Translate IP to Geo Coordinates
GeoIp Component

Pure Perl

Installing Geo IP PurePerl
GeoIP Documentation on CPAN
Apache-GeoIP on CPAN
Pure Perl Installation on Debian see post by leftbrainlogic

Ruby

Using GeoIP in Ruby from About.com spotlight
GeoIP on Rubyforge.org
GeoIP Ruby mailing list
Benchmark comparison of different methods of using Ruby to convert an IP to a lat/lon compares looking up an IP in MaxMind's binary database to importing the HostIP CSV into MySQL
Installing RubyGem and creating a geo controller rails application
Geolocation with MaxMind's GeoIP and the geoip-city RubyGem provides code snippets

mod-geoip

Apache MIT GeoIP Module German English
Installing mod_geoip on Apache2 Indonesian English
Installing mod_geoip on Apache2 for Debian Etch

Python

GeoIP-python mailing list on SourceForge
python-geoip package for Debian "This package contains the python bindings for GeoIP, allowing you to use this library within a python program and find the country of any IP address."
python-geoip package for Ubuntu same as above for Ubuntu

Java

GeoIP Java mailing list

Chicken Scheme

GeoIP API for Chicken Scheme
Chicken bindings for GeoIP C Library

Erlang

C-Driver port by Olivier Girondel

Django

Template by Rachel Willmer
Snippet for importing CSV

GeoDjango

"A GIS branch of django that intends to be a geographic web framework making it as easy as possible to build GIS web applications and harness the power of spatially enabled data."

Using GeoIP and GeoDjango with Google Maps
Snippet for GeoIP geolocation models

Distro Resources

Debian

Debian Package Search

Ubuntu

How to Install MaxMind GeoIP on Ubuntu Digg.com
Ubuntu Package Search

Fedora

Fedora Package Search

Slackware

Slackware Package Search

RPMs

Search on rpmfind

NetBSD

NetBSD

Mac OS X

How to download and install Py-geoip on Mac OS X from Dawrin Ports - Py-geop is a python module for accessing GeoIP C library
How to download and install Rb-net-geoip on Mac OS X from Darwin Ports
Installing GeoIP-Ruby on Leopard

Firewall

IPtables

GeoIP Match - iptables / netfilter
IPtables / howto extract IP ranges from the CSV
Country-based packet filtering with iptables
Upgrading Kernel + iptables geoip

Modsecurity

Apache Modsecurity with GeoIP blocking country specific traffic
Using with GeoIP from modsecurity website

fail2ban

geoiplookup w/ fail2ban

Web Stats

AWStats

Installing AWStats on CentOS includes section on GeoIP
HowTo get GeoIP City working w/ AWStats for PowWeb hosting community

Webalizer

HowTo - Webalizer w/ GeoIP Patch

AWFull (a Webalizer fork)

Main Site

SQL

PostgreSQL

Loading the GeoIP City database into PostgreSQL

MySQL

Vincent De Lau - How to import country into CSV
Maxmind GeoIP install setup tutorial using PHPMyAdmin Includes information on importing GeoIP CSV files into MySQL. Builds on Vincent De Lau's tutorial above with pictures
Geo IP - install Maxmind GeoIP using PHP + MySQL builds on link above on using PHPMyAdmin
Great links from MySQL forum
PHP Script to extract countries from a MySQL DB on the command line
Setting up MySQL GeoIP Database

MySQL Optimization

Looking up the country of an IP using spatial R-tree indexes in MySQL Great thread following post
Andy Skelton - how they do lookup at WordPress references above link
Fast SQL queries using the CSV database and PHP
Oracle

Importing GeoIP CSV files into Oracle 8i+ By Sascha Pfalz. See link to download GeoIP01.zip

MS Access

How to install the MaxMind GeoIP CSV databases into an MS Access Database


MaxMind, GeoIP and related marks are registered trademarks of MaxMind, Inc.
Copyright © 2010 MaxMind, Inc. All Rights Reserved. Terms of use.