Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:lslb:geoip [2019/08/27 19:14] Jackson Zhang [MaxMind GeoIP2 Database] |
litespeed_wiki:lslb:geoip [2019/08/27 19:22] Jackson Zhang |
||
---|---|---|---|
Line 4: | Line 4: | ||
To setup and enable GeoIP on LiteSpeed ADC, you will need to choose one database, download and install the database to a directory, setup the database path in ADC Admin, ''Enable GeoLocation Lookup'' should set to ''Yes'', then set rewrite rules in virtual host rewrite tab and finally run some tests. | To setup and enable GeoIP on LiteSpeed ADC, you will need to choose one database, download and install the database to a directory, setup the database path in ADC Admin, ''Enable GeoLocation Lookup'' should set to ''Yes'', then set rewrite rules in virtual host rewrite tab and finally run some tests. | ||
- | {{:litespeed_wiki:lslb:adc-geoip-1.png?800|}} | + | {{:litespeed_wiki:lslb:adc-geoip-11.png?800|}} |
===== set ''Enable GeoLocation Lookup'' to ''Yes'' ===== | ===== set ''Enable GeoLocation Lookup'' to ''Yes'' ===== | ||
Line 26: | Line 26: | ||
| | ||
=== Set up Database File Path and Name === | === Set up Database File Path and Name === | ||
- | In ADC WebAdmin, configure the database location and name(Both **DB File Path** and **DB Name** are mandatory and can not be empty). Your choice of DB name is important: you must use ''COUNTRY_DB'' for a country database, and ''CITY_DB'' for a city database. Navigate to **Configuration > Server > General > set **MaxMind GeoIP DB** to the database path. Then set **DB Name** to ''COUNTRY_DB'' or ''CITY_DB''. **Environment Variables** and **Notes** are optional. | + | In ADC WebAdmin, configure the database location and name(Both **DB File Path** and **DB Name** are mandatory and can not be empty). Your choice of DB name is important: you must use ''COUNTRY_DB'' for a country database, and ''CITY_DB'' for a city database. Navigate to Configuration > Server > General > set **MaxMind GeoIP DB** to the database path. Then set **DB Name** to ''COUNTRY_DB'' or ''CITY_DB''. |
+ | **Environment Variables** and **Notes** are optional. | ||
==== Advanced Configuration:GEOIP2 Environment Variables ==== | ==== Advanced Configuration:GEOIP2 Environment Variables ==== | ||
Line 80: | Line 81: | ||
{{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e1.png?800 |}} | {{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e1.png?800 |}} | ||
- | It will show on the ''phpinfo.php'' page as: | + | |
- | _SERVER["MyTest_COUNTRY_CODE"] US | + | |
''US'' will be replaced by the country code you are visiting from, such as ''SG'' or others. | ''US'' will be replaced by the country code you are visiting from, such as ''SG'' or others. | ||
Line 88: | Line 88: | ||
MyTest2_COUNTRY_CODE COUNTRY_DB_20190402/country/iso_code | MyTest2_COUNTRY_CODE COUNTRY_DB_20190402/country/iso_code | ||
{{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e2.png?800 |}} | {{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e2.png?800 |}} | ||
- | It will show on the ''phpinfo.php'' page as: | ||
- | _SERVER["MyTest2_COUNTRY_CODE"] US | ||
=== Example 4 === | === Example 4 === | ||
Line 105: | Line 103: | ||
{{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e4-1.png?600 |}} | {{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e4-1.png?600 |}} | ||
- | It will show on the ''phpinfo.php'' page as: | ||
- | _SERVER["HTTP_GEOIP_CITY"] Montville | ||
- | _SERVER["HTTP_GEOIP_POSTAL_CODE"] 07045 | ||
- | _SERVER["HTTP_GEOIP_CITY_CONTINENT_CODE"] NA | ||
- | _SERVER["HTTP_GEOIP_CITY_COUNTRY_CODE"] US | ||
- | _SERVER["HTTP_GEOIP_CITY_COUNTRY_NAME"] United States | ||
- | _SERVER["HTTP_GEOIP_REGION"] NJ | ||
- | _SERVER["HTTP_GEOIP_LATITUDE"] 40.90490 | ||
- | _SERVER["HTTP_GEOIP_LONGITUDE"] -74.36460 | ||
- | |||
- | {{ :litespeed_wiki:cache:common:litespeed-geoip2-variables-e4-2.png?400 |}} | ||
=== Setup Database File Path === | === Setup Database File Path === | ||
- | In ADC WebAdmin, configure the database location: Navigate to **Configuration > Server > General > set ''MaxMind GeoIP DB'' to the database path. | + | In ADC WebAdmin, configure the database location: Navigate to Configuration > Server > General > set ''MaxMind GeoIP DB'' to the database path. |