Web Cache Web Server Configuration - DirectAdmin Shared Hosting

This guide assumes that you have command-line access to the DirectAdmin Server.

Set Server level cache root

Add the following lines to the /etc/httpd/conf/extra/httpd-includes.conf file. check link here.

<IfModule Litespeed>
CacheRoot /home/lscache/

Note: It is recommended that you set the server level cache root to /home/lscache/ or a disk partition with enough space.

Set Virtual Host level cache root for all Virtual Hosts

Create a /usr/local/directadmin/data/templates/custom/cust_httpd.CUSTOM.2.pre file with: link here.

<IfModule Litespeed>
  CacheRoot lscache

This is done to set each Virtual Hosts' cache directory to its home directory (/home/<user>/lscache).

Apply these changes to all Virtual Hosts by running the following command:

cd /usr/local/directadmin/custombuild
./build rewrite_confs

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 as below:

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 in your application level document root .htaccess file to enable cache lookup.

<IfModule LiteSpeed>
  CacheLookup public on

After applying your cache storage settings, perform a graceful restart of LiteSpeed Web Server to have these changes take effect. LiteSpeed Web Server will automatically create cache root directories with proper permissions. Users don't need to manually create any cache root directories themselves.

service lsws restart
  • Admin
  • Last modified: 2016/12/05 20:04
  • by Jackson Zhang