Difference between revisions of "GeoIP2"

From TMM Wiki
Jump to navigationJump to search
(Created page with "{{NATS3 Manual | show_configuration_admin_section = true }} [http://www.maxmind.com/app/mod_geoip Download] and install GeoIP from Maxmind. Please ensure that you install the...")
 
Line 3: Line 3:
 
}}
 
}}
  
[http://www.maxmind.com/app/mod_geoip Download] and install GeoIP from Maxmind. Please ensure that you install the '''Apache''' Module for GeoIP, as this will not work without the GeoIP Apache API installed.
+
[https://dev.maxmind.com/geoip/geoip2/downloadable/ Download] and install the GeoIP database from Maxmind.  
  
Configure and test GeoIP, then find the ''nats/includes'' folder on your
+
There is a [https://dev.maxmind.com/geoip/geoip2/geolite2/ free] one available here
server, open the ''config.php'' file, and enter the following:
 
  
 
<pre>
 
<pre>

Revision as of 19:33, 6 February 2019

NATS 3
Configuration Admin
NATS3 Configuration Options
Extra Country Options
PayVia Minimum
Log Admin Activity
IP Address Filtering
MEMBER EXPIRE PAD
Second Sign-up Matching
Affiliate Signup Email
GeoIP
Fake Upgrade

Download and install the GeoIP database from Maxmind.

There is a free one available here

$config['IP_FILTER'] = 'GEOIP';

You can put it anywhere in the file except for after the last line.

Test Code

The following PHP code will help you test GeoIP. Put it in a file, put the file on your webserver, and load its URL. It should print your country's name.

<?
echo 'According to geoip apache module, you are from '.apache_note("GEOIP_COUNTRY_NAME");
echo '<br>According to geoip pecl php module, you are from '.geoip_country_code_by_name($_SERVER['REMOTE_ADDR']);
?>

Note: Please be sure to perform this test after you install or update Maxmind's GeoIP.

See Also