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:plesk-shared [2016/08/15 19:52]
Jackson Zhang [Set Server level cache root]
litespeed_wiki:cache:common_installation:plesk-shared [2016/08/19 19:18] (current)
Jackson Zhang [Web Cache Web Server Configuration - Plesk Multi-Site/Shared Hosting]
Line 2: Line 2:
 This guide assumes that you have command-line access to the Plesk Server in question. If you do not have command-line access, please refer to Plesk'​s documentation on [[http://​docs.plesk.com/​en-US/​12.5/​advanced-administration-guide-linux/​virtual-hosts-configuration/​virtual-hosts-and-hosting-types/​virtual-host-configuration-files.72064/​ |editing Apache configuration files]] through the Plesk GUI. This guide assumes that you have command-line access to the Plesk Server in question. If you do not have command-line access, please refer to Plesk'​s documentation on [[http://​docs.plesk.com/​en-US/​12.5/​advanced-administration-guide-linux/​virtual-hosts-configuration/​virtual-hosts-and-hosting-types/​virtual-host-configuration-files.72064/​ |editing Apache configuration files]] through the Plesk GUI.
  
 +Simply run the following script, which will set server level and virtual host level cache roots and cache policies:
 +
 +  bash <(curl http://​www.litespeedtech.com/​packages/​lscache/​set_cache_root_policy.sh)
 +
 +Please bear in mind that the script doesn'​t enable the cache lookup for user, you can add cache lookup directive to .htaccess for any particular user manually. Out WordPress Cache Management tool for Plesk can manage the bulk enabling and disabling as you want and it is currently under development.
 +
 +  <​IfModule LiteSpeed>​
 +    CacheLookup public on
 +  </​IfModule>​
 +
 +The following wiki explain steps in details to set cache root and cache policy manually, though there is no such need if the above script has been run already.
 ===== Cache Storage Settings ===== ===== Cache Storage Settings =====
 ==== Set Server level cache root ==== ==== Set Server level cache root ====
-Create a file named "lscache.conf" with the following ​content in directory ''/​etc/​httpd/​conf.d/'' ​for CentOS and ''/​etc/​apache2/​conf.d/'' ​for Debian/Ubuntu:+Create a file named ''​lscache.conf''​ in the following directory ​depending upon your system: 
 +  * For CentOS, the ''/​etc/​httpd/​conf.d/'' ​directory 
 +  * For Debian, the ''/​etc/​apache2/​conf.d/'' ​directory 
 +  * For Ubuntu, the ''/​etc/​apache2/​conf-enabled''​ directory 
 + 
 +This ''​lscache.conf''​ file should contain the following: 
 <​code>​ <​code>​
 <​IfModule Litespeed>​ <​IfModule Litespeed>​
Line 11: Line 28:
 </​code>​ </​code>​
   ​   ​
-**Note:** It is recommended ​to set the server level **Cache Root** to ''/​var/​www/​vhosts/​lscache/''​ or a disk partition with enough space. +**Note:** It is recommended ​that you set the server level **Cache Root** to ''/​var/​www/​vhosts/​lscache/''​ or a disk partition with enough space.
 ==== Set Virtual Host level cache root for all VHosts==== ​ ==== Set Virtual Host level cache root for all VHosts==== ​
  
-Create the ''/​usr/​local/​psa/​admin/​conf/​templates/​custom/​domain''​ directory if it does not already exist. Copy ''​domainVirtualHost.php''​ to this location and view it'​s ​contents. ​+Create the ''/​usr/​local/​psa/​admin/​conf/​templates/​custom/​domain''​ directory if it does not already exist. Copy ''​domainVirtualHost.php''​ to this location and view its contents. ​
  
 <​code>​ <​code>​
Line 25: Line 41:
 </​code>​ </​code>​
  
-Add the following ​content ​to the proper location (we recommend inserting after the mod_suexec.c block):+Add the following ​lines to the proper location ​in ''​domainVirtualHost.php'' ​(we recommend inserting after the ''​mod_suexec.c'' ​block):
  
 <​code> ​   <​code> ​  
Line 33: Line 49:
 </​code>​ </​code>​
   ​   ​
- This is to set cache directory for each vhost in their home directory (such as ''/​var/​www/​vhosts/<​domain_name>/​lscache''​):+This is done to set the cache directory for each vhost in each user'​s ​home directory (such as ''/​var/​www/​vhosts/<​domain_name>/​lscache''​).
    
-Reconfigure all virtual hosts ( this will regenerate new configuration files for all vhosts )+Reconfigure all virtual hosts (this will regenerate new configuration files for all vhosts).
 <​code>​ <​code>​
 /​usr/​local/​psa/​admin/​bin/​httpdmng --reconfigure-all /​usr/​local/​psa/​admin/​bin/​httpdmng --reconfigure-all
 </​code>​ </​code>​
  
-For more information on this, please refer to Plesk'​s documentation on [[http://​docs.plesk.com/​en-US/​12.5/​advanced-administration-guide-linux/​virtual-hosts-configuration/​changing-virtual-hosts-settings-using-configuration-templates.68693/​|Changing Virtual ​Hosts Settings Using Configuration Templates]].+For more information on this, please refer to Plesk'​s documentation on [[http://​docs.plesk.com/​en-US/​12.5/​advanced-administration-guide-linux/​virtual-hosts-configuration/​changing-virtual-hosts-settings-using-configuration-templates.68693/​|Changing Virtual ​Host Settings Using Configuration Templates]].
  
 ==== Set Virtual Host level cache root for a single VHost ==== ==== Set Virtual Host level cache root for a single VHost ====
-If it does not already exist, create ​a file named "vhost.conf" ​( or "vhost_ssl.conf" ​for HTTPS sites) with the following content in directory ​''/​var/​www/​vhosts/​system/<​domain_name>/​conf/'':​+Create ​a file called ''​vhost.conf''​ if it does not already exist ( or ''​vhost_ssl.conf'' ​for HTTPS sites) with the following content in the ''/​var/​www/​vhosts/​system/<​domain_name>/​conf/'' ​directory:
  
 <​code>​ <​code>​
Line 51: Line 67:
 </​code>​ </​code>​
  
-This is to set cache directory for this vhost in its home directory (such as ''/​var/​www/​vhosts/<​domain_name>/​lscache''​) .+This is to set the cache directory for this vhost in its home directory (such as ''/​var/​www/​vhosts/<​domain_name>/​lscache''​). 
 + 
 +Reconfigure this Virtual Host (this will regenerate new configuration files for this vhost).
  
-Reconfigure this Virtual Host ( this will regenerate new configuration files for this vhost )  
-  
 <​code>​ <​code>​
 /​usr/​local/​psa/​admin/​bin/​httpdmng --reconfigure-domain <​domain_name>​ /​usr/​local/​psa/​admin/​bin/​httpdmng --reconfigure-domain <​domain_name>​
Line 60: Line 76:
  
 ===== Perform A Graceful Restart ===== ===== Perform A Graceful Restart =====
-After applying above cache storage settings, perform a graceful restart of LiteSpeed ​web server ​to have these changes take effect. LiteSpeed ​web server ​will automatically create the cache root directory with proper permission. ​User doesn't need to manually create any cache root directory.+After applying ​the above cache storage settings, perform a graceful restart of LiteSpeed ​Web Server ​to have these changes take effect. LiteSpeed ​Web Server ​will automatically create the cache root directory with proper permission. ​Users don't need to manually create any cache root directories themselves.
  
 <​code>​ <​code>​
Line 68: Line 84:
  
 ===== Cache Policy Settings =====  ===== Cache Policy Settings ===== 
-LiteSpeed Cache default settings work well with most caching scenarios. ​For shared hosting environment, ​please ​don't change any of the **Server Level** default cache policy settings ​and leave them as "Not Set".+LiteSpeed Cache default settings work well with most caching scenarios. ​If you're configuring a shared hosting environment,​ don't change any of the **Server Level** default cache policy settings. Leave them as ''​Not Set''​.
   Cache Policy:   Cache Policy:
   Enable Public Cache:Not Set   Enable Public Cache:Not Set
Line 84: Line 100:
   Private Cache Expire Time (seconds):​Not Set   Private Cache Expire Time (seconds):​Not Set
  
-Add the following Apache style configuration directive in your application level .htaccess file to enable cache lookup.+Add the following Apache style configuration directive in your application level ''​.htaccess'' ​file to enable cache lookup.
  
   <​IfModule LiteSpeed>​   <​IfModule LiteSpeed>​
  • Admin
  • Last modified: 2016/08/15 19:52
  • by Jackson Zhang