Apache Haus Distribution of mod_geoip2/1.2.8a

Read Me File for the Apache Haus Distribution of mod_geoip2 1.2.8a
Date: August 08, 2013
Application: mod_geoip2 1.2.8a
Distribution File: mod_geoip-1.2.8a-2.4.x-x86-vc11.zip
Original source by: MaxMind, Inc.
Original Home: http://www.maxmind.com/app/mod_geoip/
   
Win32 binary by: Gregg at The Apache Haus
Mail: info@apachehaus.com
Home: http://www.apachehaus.com
   
** This build for Apache 2.2.x x86 only! **
Supported Windows Versions:
   
Windows Vista (IPv4 & IPv6)
Windows 7 (IPv4 & IPv6)
Windows Server 2008 (IPv4 & IPv6)
Windows 8 (IPv4 & IPv6)
Windows Server 2012 (IPv4 & IPv6)

Package Contents:

readme_first.html [this file]
/Apache24/modules/mod_geoip.so
/geoipdata/GeoIP.dat
/geoipdata/GeoIPv6.dat
README
Changes


NOTES:

Modules built on Visual C++ 2012 do not run on Windows XP or Windows Server 2003

Built with Visual Studio 2012 Update 3 x86, be sure to install the Visual C++ 2012 Update 3 x86 Redistributable Package
it can be downloaded from;

http://www.microsoft.com/en-us/download/details.aspx?id=30679


INTRODUCTION

mod_geoip2 is a module for Apache 2.4 that will determine country, state/region, city, US postal code, US area code, metro code, latitude, and longitude information for IP addresses worldwide.

You can use the included database (GeoIP.dat) however this wll most likely be outdated.
The database is updated monthly at maxmind.com.
http://www.maxmind.com/download/geoip/database/

mod_geoip2 outputs these environment variable using the supplied GeoLite Country (GeoIP.dat) database:
    IPv4
  • GEOIP_COUNTRY_CODE
  • GEOIP_COUNTRY_NAME
    IPv6
  • GEOIP_COUNTRY_CODE_V6
  • GEOIP_COUNTRY_NAME_V6

mod_geoip outputs these environment variable using the available GeoLite City (GeoLiteCity.dat) database from maxmind.com:
    IPv4
  • GEOIP_AREA_CODE
  • GEOIP_CITY
  • GEOIP_COUNTRY_CODE
  • GEOIP_COUNTRY_CODE3
  • GEOIP_COUNTRY_NAME
  • GEOIP_DMA_CODE
  • GEOIP_LATITUDE
  • GEOIP_LONGITUDE
  • GEOIP_REGION
    IPv6
  • GEOIP_AREA_CODE_V6
  • GEOIP_CITY_V6
  • GEOIP_COUNTRY_CODE_V6
  • GEOIP_COUNTRY_CODE3_V6
  • GEOIP_COUNTRY_NAME_V6
  • GEOIP_DMA_CODE_V6
  • GEOIP_LATITUDE_V6
  • GEOIP_LONGITUDE_V6
  • GEOIP_REGION_V6

If this is your first install of mod_bw:

To install this module on your Apache 2.4.x server you need to copy the necessary files to your Apache folder and add items to your Apache's httpd.conf file. C:\Apache24 will be used as our ServerRoot for the examples below.

1. Install the Visual C++ 2012 Redistributable Package
    Download, if you have not done so already, from the
    address above.

2. Download either the GeoIPCountry Lite or GeoIPCity Lite database from Maxmind
    or use the included GeoIPCountry Lite database.
    Untar the file and place in Apache's /bin folder
    C:/Apache24/bin/geoip.dat for example using GeoIPCountry Lite

3. Copy mod_geoip.so to your Apache 2.4.x modules folder
    C:/Apache24/modules/mod_geoip.so for example

4. Load mod_geoip.so into your Apache 2.4.x by adding the below line to your httpd.conf file
    LoadModule geoip_module modules/mod_geoip.so

5. Add the sample configuration below at the bottom of your httpd.conf file

Sample Configuration:

<IfModule geoip_module> GeoIPEnable On # Specify full path to the database here! # Use only one database. # GeoIPDBFile /path/to/GeoIP.dat # GeoIPDBFile /path/to/GeoLiteCity.dat # IPv6 support use two databases GeoIPDBFile bin/GeoIPv6.dat GeoIPDBFile bin/GeoLiteCity.dat </IfModule>

For more examples the see the README file

Directives Quick Reference
GeoIPDBFile: Path to GeoIP Data File
GeoIPEnable: Turn on mod_geoip
GeoIPEnableUTF8: Turn on utf8 characters for city names
GeoIPOutput: Specify output method(s)
GeoIPScanProxyHeaders: Get IP from HTTP_CLIENT IP or X-Forwarded-For
GeoIPToken: Turn off/on mod_geoip token in server signature, default: Off
GeoIPUseFirstNonPrivateXForwardedForIP: For more IP's in X-Forwarded-For, use the first non private IP
GeoIPUseFirstXForwardedForIP: For more IP's in X-Forwarded-For, use the first
GeoIPUseLastXForwardedForIP:  For more IP's in X-Forwarded-For, use the last

TEST MODULE

The easiest way to test this module on your Apache 2.4.x server is to goto a phpinfo() page and look at the PHP Variables. like:
    http://www.example.com/phpinfo.php

You should see some or all of the below varables de[ending on which database you chose. Note: You cannot use http://localhost to test.

_SERVER["GEOIP_ADDR"]           208.206.108.6
_SERVER["GEOIP_CONTINENT_CODE"] NA
_SERVER["GEOIP_COUNTRY_CODE"]   US
_SERVER["GEOIP_COUNTRY_NAME"]   United States
_SERVER["GEOIP_REGION"]         CA
_SERVER["GEOIP_REGION_NAME"]    California
_SERVER["GEOIP_CITY"]           Vista
_SERVER["GEOIP_DMA_CODE"]       825
_SERVER["GEOIP_AREA_CODE"]      760
_SERVER["GEOIP_LATITUDE"]       33.200699
_SERVER["GEOIP_LONGITUDE"]      -117.225502