Maxmind GeoIP Module

padams edited this page Apr 2, 2015 · 2 revisions

Maxmind GeoIP is a module that will perform geo-location lookups of a visitor's Ip address using the Maxmind GeoLite City database or the Maxmind GeoIP City/Isp/Org Web Service.

The module requires explicit activation and when it is filters OWA's Geolocation object to include information from Maxmind.

Installation

This module can be activated from either the CLI or Administrative interface. it requires configuration prior to activation.

Geo Lite City Database Configuration

The Maxmind City Lite databse must be downloaded from the Maxmind web (http://www.maxmind.com/app/geolitecity) and placed in a Maxmind data directory that you create within OWA's data directory (e.g. /pathto/owa/owa-data/maxmind/GeoLiteCity.dat).

Currently OWA only supports the "legacy DB format provided by MaxMind. To use the Citylite2 format be sure to run the code in master.

Alternatively, you may specify an alternate location for the Maxmind data directory by defining a path to it using the OWA_MAXMIND_DATA_DIR constant in your owa-config.php. For example:

define( 'OWA_MAXMIND_DATA_DIR', '/path/to/maxmind/data/dir/');

Maxmind GeoIP City/Isp/Org Web Service Configuration

The module may be configured to use the Maxmind City/Isp/Org Web Service instead of a local database. To use this web service you must first purchase a web service license key from Maxmind at http://www.maxmind.com/app/web_services.

Once you have obtained a key, you will need to set two settings by adding the following to your owa-config.php configuration file:

$this->set('maxmind_geoip', 'lookup_method', 'geoip_city_isp_org_web_service'); $this->set('maxmind_geoip', 'ws_license_key', 'YOUR_LICENSE_KEY');