![]() You can use these variables or notes table entries in the configuration directives for other modules, such as mod_rewrite. Reload the Apache configuration using the command /etc/rc.d/init.d/httpd reload after making the changes.īy default, mod_geoip-enabled Apache sets up two environment variables and Apache notes table entries, GEOIP_COUNTRY_CODE and GEOIP_COUNTRY_NAME. GeoIPDBFile /usr/local/share/GeoIP/GeoIPCountry.dat LoadModule geoip_module modules/mod_geoip.so To compile the mod_geoip source archive and install the shared module, use the apxs command:Īpxs -i -a -L/usr/local/lib -I/usr/local/include -lGeoIP -c mod_geoip.cĪfter installing the module, you need to add the following lines to Apache configuration file /etc/httpd/conf/nf, or to the module-specific configuration file /etc/httpd/conf.d/mod_nf, to load the module into Apache and enable it: The C API has the country database file in binary form bundled with it. You need the GeoIP C API installed to compile mod_geoip. You can install mod_geoip from an RPM file or compile it from source. MaxMind also offers a dynamic shared module for Apache, mod_geoip, which enables Apache to query the location databases to identify the location of visitors. ![]() CSV files are handy if you have complex requirements and need custom routines to access the data if not, you’re better off with the ready-to-use binary database files for use with MaxMind’s APIs. You can download their free lite versions from MaxMind as either CSV or binary files. GeoIP’s two databases are called GeoIP Country and GeoIP City. MaxMind has released lite versions of the databases under an Open Data License, and offers databases enhanced with information from additional sources under a commercial licensing model. ![]() ![]() Bundled with the data are LGPLed APIs for accessing those databases using C, PHP, Java, and a few other languages. GeoIP is a set of databases that map IP addresses to country, city, and Internet service provider (ISP). A better approach is a database that maps each IP address to a location - such as MaxMind’s GeoIP. Techniques like whois lookup of IP addresses are of some help, but they don’t always find accurate locations. Geolocation information can help you localize content, serve relevant local advertisements, offer a download mirror close to visitors, and detect online fraud. ![]() If you maintain a portal, ecommerce site, or heavily trafficked Web site, you might appreciate the ability to identify the geographical location of your site visitors. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |