usmannasir / cyberpanel

Cyber Panel - The hosting control panel for OpenLiteSpeed
GNU General Public License v3.0
1.6k stars 613 forks source link

Where is Litespeed cache location on the server? #557

Closed planetahuevo closed 3 years ago

planetahuevo commented 3 years ago

It is not located on the standard route from openlitespeed. I need to be able to clear the cache of the server using CLI, but this page: https://docs.litespeedtech.com/lscache/manualpurge/ and the information here https://docs.litespeedtech.com/lscache/basics/ does not work with the installation from Cyberpanel.

The virtual host cache root directory is normally located in /home/$USER/lscache for shared hosting users, or /tmp/diskspace for dedicated servers. How can we find the lscache directory for each website?

Thanks

qtwrk commented 3 years ago

for LSWS it's on /home/domain.com/lscache/ , for OLS , it's all in /usr/local/lsws/cachedata/

patrickgarsow commented 3 years ago

There is also cache at /usr/local/lsws/tmp/ocspcache

planetahuevo commented 3 years ago

Thank you @patrickgarsow and @qtwrk On OLS, how do we remove the cache files for a site? And for the server, can we just remove the whole folder? Thanks

qtwrk commented 3 years ago

by default on OLS it's all in same dir , so you can't really just remove cache file for a site

if you do things like rm -rf /usr/local/lsws/cachedata/* it will remove cache file for all sites

if you want to separated cache dir per site , you will need to do some manual configuration on OLS vhost setting

module cache {
storagePath /home/$VH_NAME/lscache
  ls_enabled              1
}

add this into your vhost conf , it will create dir like /home/domain.com/lscache to match LSWS behavior.

planetahuevo commented 3 years ago

That is great info @qtwrk Thank you very much. I suppose I can work with the rm for now. It is nice to know that can be done so easily, but I prefer to keep the defaults from Cyberpanel.

This could be a nice addition to it by the developers :)

patrickgarsow commented 3 years ago

@planetahuevo Possible Feature Request is an advanced config area that allows for such a setting to be turned off or on. Consider requesting it at: https://feedback.cyberpanel.net/

The manual config is really easy by going to WEBSITES --> LIST WEBSITES --> Find the site and click Manage --> Scroll To CONFIGURATIONS --> Click vHost Conf --> then add qtwrk's entry --> Click Save

I did note however this is per domain and doesn't include child/subdomains so it would need to be done to each.