Date: August 08, 2013 | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
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 http://www.microsoft.com/en-us/download/details.aspx?id=30679 INTRODUCTIONmod_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.
mod_geoip outputs these environment variable using the available GeoLite City (GeoLiteCity.dat) database from maxmind.com:
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 PackageDownload, 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: For more examples the see the README file Directives Quick ReferenceGeoIPDBFile: 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 MODULEThe 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: _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 | |||||||||||||||||||||||||||||||||||