Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
litespeed_wiki:cache:common_installation:apache-config-shared [2016/05/05 19:39] Michael Alegre |
litespeed_wiki:cache:common_installation:apache-config-shared [2016/09/30 13:40] Jackson Zhang [Set virtual host level cache root] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Web Cache Web Server Configuration - Apache Config (No Control Panel) Multi-Site/Shared Hosting ====== | + | ====== Web Cache Web Server Configuration - Apache Config (No Control Panel) ====== |
- | ==== Cache Storage Settings ==== | + | ===== Cache Storage Settings ===== |
- | === Set Server level cache root === | + | ==== Set Server level cache root ==== |
- | Set a server level cache root by add the following to your server level Apache config file: | + | Set a server level cache root by adding the following lines to your server level Apache config file: |
<IfModule Litespeed> | <IfModule Litespeed> | ||
- | CacheRoot /tmp/lscache | + | CacheRoot /home/lscache/ |
</IfModule> | </IfModule> | ||
| | ||
- | **Note:** make sure /tmp/lscache exists and server readable/writeable (nobody:nobody for cPanel). CacheRoot is an absolute path for server level setting | ||
- | === Set virtual host level cache root === | ||
- | The vhost host level cache root is normally a per user cache root set to a subfolder under a user's home directory. | ||
- | If using a virtual host include file (as opposed to .htaccess) a relative path can be used for "CacheRoot" such as | + | ==== Set virtual host level cache root ==== |
+ | The vhost level cache root is normally a per user cache root set to a subdirectory under a user's home directory. | ||
+ | |||
+ | If using a virtual host include file (as opposed to ''.htaccess'') a relative path can be used for "CacheRoot" such as | ||
<IfModule LiteSpeed> | <IfModule LiteSpeed> | ||
Line 18: | Line 18: | ||
</IfModule> | </IfModule> | ||
- | The cache directory will be created automatically as "lscache" if not exists under user's home directory. | + | If it does not exist, the cache directory will be created automatically by LiteSpeed Web Server during startup as ''lscache'' under the user's home directory. |
- | ==== Cache Policy Settings ==== | + | **Notes:** If different vhosts share the same document root, these vhosts have to share the same vhost level cache root directory. |
- | Add the following Apache style configuration directive in .htaccess to enable cache lookup. | + | |
+ | ===== Cache Policy Settings ===== | ||
+ | |||
+ | The default LiteSpeed Cache 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: | ||
+ | Enable Public Cache:Not Set | ||
+ | Check Public Cache:Not Set | ||
+ | Max Object Size:Not Set | ||
+ | Cache Expire Time (seconds):Not Set | ||
+ | Cache Stale Age (seconds)Not Set | ||
+ | Cache Request with Query String:Not Set | ||
+ | Cache Request with Cookie:Not Set | ||
+ | Cache Response with Cookie:Not Set | ||
+ | Ignore Request Cache-Control:Not Set | ||
+ | Ignore Response Cache-Control:Not Set | ||
+ | Enable Private Cache:Not Set | ||
+ | Check Private Cache:Not Set | ||
+ | Private Cache Expire Time (seconds):Not Set | ||
+ | |||
+ | Add the following Apache style configuration directive to ''.htaccess'' file of a specific WordPress installation to enable cache lookup. | ||
<IfModule LiteSpeed> | <IfModule LiteSpeed> | ||
CacheLookup public on | CacheLookup public on | ||
</IfModule> | </IfModule> | ||
- | |||
- | Perform a web server graceful restart. | ||
- | |||
- | **Note:** Shared hosting providers can selectively enable LSCache by setting **Check Public Cache** to "No" at the server level (Configuration>>Server>>Cache>>Cache Policy) and then adding this directive in the .htaccess file of a specific WordPress installation. This will have the effect of turning on LSCache for only this site, allowing you to choose which sites have caching enabled. | ||
- | ==== Advanced Cache Configuration ==== | + | **Note:** |
+ | * **"Enable Public Cache"** should always be "Not Set" or "No" unless you want to enable cache globally, which is definitely not recommended. | ||
+ | * **Check Public Cache** better set to "Not Set" but should never be "No" otherwise it will turn off the cache lookup and LScache won't work. | ||
+ | ===== 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]]**. |