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
Last revision Both sides next revision
litespeed_wiki:cache:common_installation:cpanel-shared [2019/01/25 17:37]
Lucas Rolff [Setting Cache root to a secondary disk (with CageFS)]
litespeed_wiki:cache:common_installation:cpanel-shared [2019/04/22 17:32]
Michael Alegre Shortened WHM plugin section to link to the appropriate page.
Line 8: Line 8:
   * Manually from the Command Line   * Manually from the Command Line
  
-===== Setting Cache Root via WHM Plugin ===== +===== Setting Cache Roots via WHM Plugin ===== 
-The preferred way to set up the cache root is through the WHM plugin.+The preferred way to set up the needed ​cache roots is through the WHM plugin. Detailed steps on how to do this can be found [[litespeed_wiki:​cpanel:​whm-plugin-lscwp-management#​cache_root_setup|here]].
  
-Click **WHM Plugin > LiteSpeed Configuration > Cache Root Setup** +===== Setting ​Cache Roots and Policies from a Command Line Script =====
- +
-{{:​litespeed_wiki:​cpanel:​screen_shot_2016-09-29_at_10.45.06_am.png?​nolink|}} +
- +
-More information on this process can be found on our [[litespeed_wiki:​cpanel:​whm-plugin-lscwp-management#​cache_root_setup|WHM Plugin page]]. +
- +
-==== Server Level ==== +
- +
-This screen searches for server-level cache root definitions in either the ''/​usr/​local/​apache/​conf/​includes/​pre_main_global.conf''​ file or in the LiteSpeed Web Server Web Admin **Storage Path** setting found under **Server > Cache > Cache Storage Settings**. +
- +
-If it is defined in ''​pre_main_global.conf''​ it should look something like this: +
- +
-  <​IfModule LiteSpeed>​ +
-  CacheRoot /​home/​lscache/​ +
-  </​IfModule>​ +
- +
-In this example, the server-level cache root is set to ''/​home/​lscache/''​ +
- +
-==== VHost Level ==== +
-Additionally,​ this screen searches for virtual-host-level cache root definitions in the ''/​usr/​local/​apache/​conf/​userdata/​lscache_vhosts.conf''​ file. +
- +
-If it is defined in ''​lscache_vhosts.conf''​ it should look something like this: +
- +
-  <​IfModule LiteSpeed>​ +
-  CacheRoot lscache +
-  </​IfModule>​ +
-   +
-In this example, the vhost-level cache root will be set to ''/​home/<​user_folder>/​lscache''​ +
- +
-==== Set Missing ​Cache Roots ==== +
-The **Set Missing Cache Roots** button sets server-level and vhost-level cache root definitions if they are detected as not set. This button will only appear if at least one of the two cache roots (server level or vhost level) is detected as not set. +
- +
-===== Setting Cache Root and Policies from a Command Line Script =====+
 You may use the command line instead of the WHM plugin. Simply run the following script, which will set server level and virtual host level cache roots and cache policies: You may use the command line instead of the WHM plugin. Simply run the following script, which will set server level and virtual host level cache roots and cache policies:
  
Line 65: Line 33:
   </​IfModule>​   </​IfModule>​
  
-===== Setting Cache Root and Policies Manually from the Command Line =====+===== Setting Cache Roots and Policies Manually from the Command Line =====
 The steps that follow will guide you through manually setting cache root and cache policy settings. The steps that follow will guide you through manually setting cache root and cache policy settings.
  
Line 157: Line 125:
 For Advanced Cache Configuration info, **[[litespeed_wiki:​cache:​common_installation:​advanced|look here]]**. For Advanced Cache Configuration info, **[[litespeed_wiki:​cache:​common_installation:​advanced|look here]]**.
  
-===== Setting Cache root to a secondary disk (with CageFS) ===== +===== Setting Cache Roots to a Secondary Disk (with CageFS) ===== 
-In some environments,​ you might run with normal hard drives for ''/​home'',​ but you want to place your ''​lscache''​ data on SSDs, such as ''/​ssdcache/​lscache''​. This requires a bit special configuration both within your CacheRoot setting as well as CageFS.+In some environments,​ you might run with normal hard drives for ''/​home'',​ but you want to place your ''​lscache''​ data on SSDs, such as ''/​ssdcache/​lscache''​. This requires a bit of special configuration both within your CacheRoot setting as well as CageFS.
  
 Make sure that your secondary disk is mounted on ''/​ssdcache''​ and that the directory ''​lscache''​ exists. Make sure that your secondary disk is mounted on ''/​ssdcache''​ and that the directory ''​lscache''​ exists.
Line 168: Line 136:
   </​IfModule>​   </​IfModule>​
  
-The above 3 lineswill tell LiteSpeed that the vhost level cache corresponds to a dynamic ​lscache ​folder ​matching ​the user of the VirtualHost, this will ensure that the cache for each customer gets separated.+The above 3 lines will tell LiteSpeed that the vhost-level cache corresponds to a dynamic ​LSCache ​folder ​which matches ​the user of the VirtualHost. This will ensure that the cache for each customer gets separated.
  
-If you're using CageFS, you also need to expose this within the caged environment, ​luckily ​it's rather easy to do!+If you're using CageFS, you also need to expose this within the caged environment. Luckily, it's rather easy to do!
  
 In your ''/​etc/​cagefs/​cagefs.mp''​ file, you can add the line: In your ''/​etc/​cagefs/​cagefs.mp''​ file, you can add the line:
Line 183: Line 151:
   /​scripts/​restartsrv_httpd   /​scripts/​restartsrv_httpd
  
-Afterwards we have to remount CageFS for all users, so the new path becomes available within CageFS:+Afterwardswe have to remount CageFS for all users, so the new path becomes available within CageFS:
  
   cagefsctl --remount-all   cagefsctl --remount-all
  
-Your lscache ​data will now be stored on the SSD instead of your hard drive!+Your LSCache ​data will now be stored on the SSD instead of your hard drive!
  • Admin
  • Last modified: 2021/10/06 15:20
  • by Lisa Clarke