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:cache:common_installation:cpanel-shared [2018/02/05 17:19] Lisa Clarke Proofreading and streamlining |
litespeed_wiki:cache:common_installation:cpanel-shared [2019/01/25 19:37] Lisa Clarke [Setting Cache root to a secondary disk (with CageFS)] Proofreading |
||
---|---|---|---|
Line 10: | Line 10: | ||
===== Setting Cache Root via WHM Plugin ===== | ===== Setting Cache Root via WHM Plugin ===== | ||
The preferred way to set up the cache root is through the WHM plugin. | The preferred way to set up the cache root is through the WHM plugin. | ||
+ | |||
+ | Click **WHM Plugin > LiteSpeed Configuration > Cache Root Setup** | ||
{{:litespeed_wiki:cpanel:screen_shot_2016-09-29_at_10.45.06_am.png?nolink|}} | {{: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 ==== | ==== Server Level ==== | ||
Line 152: | Line 156: | ||
==== Advanced Cache Configuration ==== | ==== Advanced Cache Configuration ==== | ||
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) ===== | ||
+ | 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. | ||
+ | |||
+ | Within ''/etc/apache2/conf.d/userdata/lscache_vhosts.conf'', you'll have to add the following content: | ||
+ | |||
+ | <IfModule Litespeed> | ||
+ | CacheRoot /ssdcache/lscache/$vh_user | ||
+ | </IfModule> | ||
+ | |||
+ | 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! | ||
+ | |||
+ | In your ''/etc/cagefs/cagefs.mp'' file, you can add the line: | ||
+ | |||
+ | %/ssdcache/lscache | ||
+ | |||
+ | By using ''%'' in front of the path, it utilizes the "split by username" functionality added in CageFS 5.3.1, so what will be exposed within CageFS will be ''/ssdcache/lscache/$user''. | ||
+ | |||
+ | To apply the above changes, we first rebuild the httpd configuration in cPanel and restart LiteSpeed: | ||
+ | |||
+ | /scripts/rebuildhttpdconf | ||
+ | /scripts/restartsrv_httpd | ||
+ | |||
+ | Afterwards, we have to remount CageFS for all users, so the new path becomes available within CageFS: | ||
+ | |||
+ | cagefsctl --remount-all | ||
+ | |||
+ | Your LSCache data will now be stored on the SSD instead of your hard drive! |