Cache storage path for litemage on shared hosting

wanah

Well-Known Member
#1
Hello,

I have just read your magento litemage cache instructions again and realised that I hadn't noticed the following :

A Server With Multiple Magento Sites
For a server with multiple Magento sites, you must set a separate cache storage path for each virtual host.
Is this still true ? Can't you make this automatic by using a folder per username or a folder per vhost ?

We do cPanel shared hosting, litemage makes it possible to do this with magento websites, however we would prefer to not have to manually set up the cache folder for each new account.

Thanks
 

Pong

Administrator
Staff member
#2
If LiteMage Cache root is set on server level at certain location, cache can be automatically created but end user can not manage their own cache storage.

If you want it to be manageable at virtual host level, you can instead place the CacheRoot section in an Apache include file (Such as litemage.conf) under /usr/local/apache/conf/userdata and creating a cache directory in each user's home directory. This is a manual process since some vhosts may not need Magento setup at all for share hosting environment.
 

wanah

Well-Known Member
#3
Hello, does this mean that without an individual cache folder, user's can't clear their sites cache ?

If this is the case, could you maybe write some instructions as to how to automate this on new account creation in cPanel ?

Thanks
 

Pong

Administrator
Staff member
#4
Yes, the steps have been included in the wiki:
https://www.litespeedtech.com/suppo...:litemage:installation#cache_storage_settings

create /home/user1/litemage_cache

place the following in apache configuration for virtual host,
<IfModule LiteSpeed>
CacheRoot litemage_cache
</IfModule>

for cPanel, need to be a include file in
/usr/local/apache/conf/userdata

Please also refer cPanel document on how to modify the virtualhost configuraiton:
https://documentation.cpanel.net/display/EA/Modify+Virtualhost+Containers+With+Include+Files
 

wanah

Well-Known Member
#5
Hello,

Yes that's for just one user, but we would like it for all users and don't want to have to manually create a new file for every new user. We currently store our cache in /dev/shm/lscache so I guess we would want to have a structure like /dev/shm/lsmagecache/$USER
 

Pong

Administrator
Staff member
#6
As we addressed, if you would like end use to manage their own cache storage, you can not place it under a centralized location, but only user home directory for cPanel.

However you can achieve the same goal by:

1. user cPanel skeleton folder:
mdkir /root/cpanel3-skel/litemage_cache

then cpanel will create such directory for new users automaticly.

https://documentation.cpanel.net/display/ALD/Skeleton+Directory

2. use include file to apply to all virtual hosts instead of just certain one:

vi /usr/local/apache/conf/userdata/litemage.conf


<IfModule LiteSpeed>
CacheRoot litemage_cache
</IfModule>


https://documentation.cpanel.net/display/EA/Modify+Virtualhost+Containers+With+Include+Files
 

wanah

Well-Known Member
#7
Ok I understand now I didn't understand it was relative to the user's account.
If I do this for all users and if that directory doesn't exist on their account will their site stop working or will the logs fill up or will that directory create itself ?
At the moment only a small percent of our customers are likely to use litemage but I want it to work for any customers that want it.
 

Pong

Administrator
Staff member
#8
If you set a directory for all users, LSWS will create sub-folders if required. There are no problem for users to setup and use their magneto store, but end users can not manage their own storage space, Only you can manage.
 

wanah

Well-Known Member
#9
Do you mean it has to have specific folder owner and chmod ?
What I mean is if I already have 300 accounts on a server to which I add

<IfModule LiteSpeed>
CacheRoot litemage_cache
</IfModule>

to all vhosts… but no users have this directory, will the logs get full ? will websites stop working because the folder is missing ?

Thanks
 

wanah

Well-Known Member
#13
OK so we will have to set up a cron to make sure all users have a cache folder no matter what script they are using and add the lscache line to the global vhost template.
By managing their own cache I presume you mean to have the ability to purge a page from the cache ? If we don't do this then they can't purge pages from cache ?

Thanks
 
Top