Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
litespeed_wiki:cache:lscache:geoip-support [2016/02/25 17:22]
Jackson Zhang created
litespeed_wiki:cache:lscache:geoip-support [2019/01/08 18:58]
Jackson Zhang
Line 1: Line 1:
 ===== How to enable geolocation for LSCache ===== ===== How to enable geolocation for LSCache =====
  
-LSCache supports GEOIP. ​To enable itthe following steps need to be followed.+LSCache supports GEOIP. ​You should [[litespeed_wiki:​cache:​common:​geoip-support|enable ​GeoIP module]] on LSWS firstly and test it to ensure ​the module is working. Then you can use different rewrite rules to meet your cache need
  
-1. Enable Geolocation database  +For example, ​to make cache vary by ''​GEO_COUNTRY'',​ you can add the following rewrite rules to your “.htaccess” file:
- +
-From LSWS Web Console: General ->​General settings:​->​ [[https://​www.litespeedtech.com/​docs/​webserver/​config/​general#​enableIpGeo|Enable IP GeoLocation]] -> Yes +
- +
- +
-2. Install GeoIP database +
-For CentOS user: +
-  yum install Geoip-data +
-Also check the installation location +
-  rpm -ql Geoip-data +
-   +
-3. Install other modules: +
-  yum install GeoIP GeoIP-devel zlib-devel +
- +
-4. Enable GeoIP on Apache Conf Config by placing the the following directive as the same way as apache. +
-   ​GeoIPEnable On +
-5. User rewrite rule to control the redirect: +
- +
-  ​For example, add the following rewrite rules to your “.htaccess” file:+
   ​   ​
   <​IfModule LiteSpeed>​   <​IfModule LiteSpeed>​
Line 28: Line 10:
   </​IfModule>​   </​IfModule>​
  
-You can add rewrite condition for more specific rules, such as UK, EU and US + rest of the world show    different contents, or show different currencies.+You can add rewrite condition for more specific rules, such as UK, EU and US + the rest of the world show different contents, or show different currencies. ​ 
  • Admin
  • Last modified: 2022/04/20 19:07
  • by Lisa Clarke