Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:cache:common_installation:shared-enable-individually [2017/09/11 15:36]
Jackson Zhang [Other control panels]
litespeed_wiki:cache:common_installation:shared-enable-individually [2020/02/20 16:04] (current)
Jackson Zhang [CacheEngine on/off directives]
Line 1: Line 1:
-====== ​How to disable ​cache globally ​but enable ​for a particular virtual host on shared hosting ​environment?​ ======+====== ​Enabling Cache/​ESI/​Crawler for an Individual Virtual Host ====== 
 + 
 +A shared hosting provider may want to maintain server-wide control over the enabling and disabling of cache-related services. These services include caching itself as well as the ESI and Crawler functions available with our WordPress LSCache Plugin. By disabling the cache globally ​and enabling it for a particular virtual hostshared hosting ​providers may offer LSCache as an add-on service to their customers.  
 + 
 +''​esi''​ and ''​crawler''​ are disabled by default during the initial installation and you will need to enable them specifically. 
 ===== CacheEngine on/off directives ===== ===== CacheEngine on/off directives =====
-Shared hosting provider may want to have more control on cache on/off, esi on/off, crawler on/off (esi and crawler are only applied to WordPress cache plugin at the time of this writing). This way, shared hosting provider provide lscache as an add on services to their customer. You can use the following directives to disable cache on a global level, such as cpanel's pre_main_global,​ and enable it on virtual host include file ( but not .htaccess) ​to enable it individually.+ 
 +Use the following directives to disable cache on a global level, such as with cPanel'​s ​''​pre_main_global''​, and enable it individually in a virtual host include file ( but not ''​.htaccess''​).
  
 To disable cache: To disable cache:
 +  <​IfModule Litespeed>​
   CacheEngine off   CacheEngine off
 +  </​IfModule>​
 + 
   ​   ​
 To enable cache, esi and crawler: To enable cache, esi and crawler:
 +  <​IfModule Litespeed>​
   CacheEngine on esi crawler   CacheEngine on esi crawler
 +  </​IfModule>​
   ​   ​
 To enable cache, but neither esi nor crawler: To enable cache, but neither esi nor crawler:
 +  <​IfModule Litespeed>​
   CacheEngine on   CacheEngine on
- +  </​IfModule>​ 
-===== Examples: ​How to disable cache globally and enabling it individually on a cpanel server? ​=====   +===== Examples: ​cPanel ​=====   
-The directives should be placed within <​IfModule Litespeed>​ .. </​IfModule>,​ could be right after the CacheRoot configurations. +To disable cache globally, add the directive ​to the ''​/​usr/​local/​apache/​conf/​includes/​pre_main_global.conf'' ​file for EA3 or the ''​/​etc/​apache2/​conf.d/​includes/​pre_main_global.conf'' ​file for EA4. It should be placed within ''<​IfModule Litespeed>​ .. </​IfModule>'',​ right after the CacheRoot configuration,​ like so:
- +
-For example for cPanel server, to disable cache globally+
- ​Add ​the above to the /​usr/​local/​apache/​conf/​includes/​pre_main_global.conf file for EA3 or the /​etc/​apache2/​conf.d/​includes/​pre_main_global.conf file for EA4+
  
   <​IfModule Litespeed>​   <​IfModule Litespeed>​
Line 24: Line 32:
   </​IfModule>​   </​IfModule>​
   ​   ​
-then enable it in a particular virtual host+To enable it for a particular virtual host (in this example, ​Apache 2.2 installation ​with an HTTP site), create ​a file named ''​lscache_vhost.conf''​ in the ''/​usr/​local/​apache/​conf/​userdata/​std/​2_2/<​user>/<​domain>/''​ directory for EA3 or ''/​etc/​apache2/​conf.d/​userdata/​a/​std/​2_2/<​user>/<​domain>/''​ directory for EA4. If this directory does not exist, create it. Add the following lines:
- +
-**Example:​** ​Apache 2.2 installations ​with an HTTP site +
- +
-Create ​a file named ''​lscache_vhost.conf''​ in the ''/​usr/​local/​apache/​conf/​userdata/​std/​2_2/<​user>/<​domain>/''​ directory for EA3 or ''/​etc/​apache2/​conf.d/​userdata/​a/​std/​2_2/<​user>/<​domain>/''​ directory for EA4 (if this directory does not exist, create it) with the following lines:+
  
 <​code>​ <​code>​
Line 37: Line 41:
 </​code>​ </​code>​
  
-This will set the cache directory for this Virtual Host to /​home/<​user>/​lscache.+This will set the cache directory for this Virtual Host to ''​/​home/<​user>/​lscache''​.
  
-Apply these changes to this Virtual Host by running the ''​ensure_vhost_includes''​ script with the following flag:+Apply the changes to this Virtual Host by running the ''​ensure_vhost_includes''​ script with the following flag:
  
 <​code>​ <​code>​
Line 47: Line 51:
 For HTTPS sites or Apache 2.4 installations,​ please refer to cPanel'​s documentation on [[https://​documentation.cpanel.net/​display/​EA/​Modify+Virtualhost+Containers+With+Include+Files|modifying virtual host containers with include files]]. For HTTPS sites or Apache 2.4 installations,​ please refer to cPanel'​s documentation on [[https://​documentation.cpanel.net/​display/​EA/​Modify+Virtualhost+Containers+With+Include+Files|modifying virtual host containers with include files]].
 ===== Other control panels ===== ===== Other control panels =====
-If you use other control panels, you should be able to use the similar directives ​to control the cache for your shared hosting accounts.+If you use other control panels, you should be able to adapt the above instructions in order to control the cache for your shared hosting accounts.
  
 ===== Enabling the WordPress Crawler ===== ===== Enabling the WordPress Crawler =====
  
-Enabling crawler is applicable for LiteSpeed WordPress plugin at the time of this writing and may be expanded to other application support when these LiteSpeed cache plugins become available.  +For details on how to enable ​the crawler ​for WordPress, pleaser refer to [[litespeed_wiki:​cache:​lscwp:​configuration:​enabling_the_crawler|How to enable crawler for WordPress ]]. (Crawler support may be expanded to other applications when those LiteSpeed cache plugins become available.)
- +
-For details on how to enable crawler, pleaser refer to [[litespeed_wiki:​cache:​lscwp:​configuration:​enabling_the_crawler|How to enable crawler for WordPress ]]+
  • Admin
  • Last modified: 2017/09/11 15:36
  • by Jackson Zhang