This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Install & configuration » Shared var folder and cache
expandshrink

Shared var folder and cache

Shared var folder and cache

Thursday 26 May 2011 1:27:27 pm - 19 replies

Hi!

We have different 2 ez publish installations sharing database.. we need, then, to share the var directory, so we are trying to create a soft link on the server from one var folder to the var folder of the other installation.

We are getting some problems with it, the main one being that we are unable to set different caches folders for each installation. Looking at the ez doc it seems that it is possible to set up differnet cache folders via site.ini, something like:

[FileSettings]
VarDir=ln_to_var
CacheDir=cache_folder_inside_var

But this is not working, the caches are being shared for the two insatallations, and we need each one to have itself caches.

Any help please?

thanks!

Sergi.

Thursday 26 May 2011 2:46:14 pm

Hello

First there's no need to do a soft link here, simply enter the same [FileSettings].VarDir in both siteaccesses.

Then, why do you want to have separate cache folders if you share the same database ?

Thursday 26 May 2011 3:02:35 pm

Just to make it clear, you have two different eZP installations or you have two different siteaccesses using the same database?

The method you suggested should work, I have used it many times. Some things to check:

  • did you set the ini settings properly?
  • did you clear the cache?
  • if you go to the admin of each site do you see different values for the CacheDir setting?

Also, are you sure that two separate eZP installations is what you need? Note that you can use spearate siteaccesses that have different design, extensions etc...

Thursday 26 May 2011 4:01:42 pm

It's 2 different installations, 2 different websites (2 differnet domain names).. that's why i can't do it with separated siteaccesses.

I can see 2 different CacheDir settings on both admin interfaces, but i'm missing something.. is the CacheDir on FileSettings, right?

Thursday 26 May 2011 4:10:05 pm

Sites on different domains can be setup on the same eZ publish installation, see here:

As for your problem, yes it is [FileSettings].CacheDir ini site.ini.

Hm, did you maybe link the cache folders instead of var dir?

Thursday 26 May 2011 6:10:01 pm

Yes, i linked the var dir... the problem i see is that after clearing caches, the first website that is accesed is the one that generates the cache for both of them... which shouldn't be that way as I state 2 different cache folder for each one.

/var/ezflow_site/cache1
/var/ezflow_site/cache2

Then on override/site.ini.php.append

[FileSettings]
VarDir=var/ezflow_site
CacheDir=var/ezflow_site/cache1

changing cache2 for cache1 in the other installation... and the problem I see is that the first genreated is the one that remains...

Thanks for the link, but i think this should work..

Modified on Thursday 26 May 2011 6:13:45 pm by Sergi A

Friday 27 May 2011 10:14:29 am

Afik, if they share db then they should share cache folder as well.

Cache clearing from shared admin interface won't work otherwise for instance.

Modified on Friday 27 May 2011 10:16:20 am by André R

Friday 27 May 2011 10:29:59 am

Afik, if they share db then they should share cache folder as well.

Cache clearing from shared admin interface won't work otherwise for instance.

So is there any way of not sharing caches? which problems would carry?

Friday 27 May 2011 10:41:53 am

[FileSettings]

VarDir=var/ezflow_site
CacheDir=var/ezflow_site/cache1

This should be:

[FileSettings]
VarDir=var/ezflow_site
CacheDir=cache1

Thanks for the link, but i think this should work..

If you don't have any real reason why to use two different installations on the same db, I strongly suggest to use one installation with different siteaccesses.

Using separate installations can really complicate your life when doing upgrades or installing new extensions etc.

Modified on Friday 27 May 2011 12:57:05 pm by Mavko Žmak - Žmale

Friday 27 May 2011 10:45:33 am

Afik, if they share db then they should share cache folder as well.

Cache clearing from shared admin interface won't work otherwise for instance.

So is there any way of not sharing caches? which problems would carry?

Yes there is. If you specify different cache folders, then the cache will not be shared. I did it on many many installations and it works without problems.

Why isn't working for you, I don't know.

But you could try this...

  • clear the caches manually (delete the cache1 and cache2 folders)
  • open a page on site1
  • open a page on site2

After that see if the the cache1 and cache2 folders were recreated and what's their content.

Friday 27 May 2011 12:51:47 pm

Both are using the same folder always... i don't know why... anyway, what's the difference between the cache folder inside ezflow_site and the on inside the var folder, please? i try to state both on the ini file, but no luck.

Friday 27 May 2011 1:00:13 pm

Both are using the same folder always... i don't know why... anyway, what's the difference between the cache folder inside ezflow_site and the on inside the var folder, please? i try to state both on the ini file, but no luck.

If you set it like this:

[FileSettings]
VarDir=var/ezflow_site
CacheDir=cache1

The cache will be created in:

var/ezflow_site/cache1

If you set CacheDir=var/ezflow_site/cache1 I'm not sure, but I suppose cache will be in:

var/ezflow_site/var/ezflow_site/cache1

The main point is, CacheDir is appended to VarDir.

Monday 30 May 2011 12:07:25 pm

Can't get it working.. now both cache dirs are being created on var/ezflow_site, which seems to be ok.. but then i get same title pages on both sites, same page path (breadcrumbs) on both... and now the styles are being mixed on one of them..

I don't know what else can i do, it should work .. I'm missing somehing

Modified on Monday 30 May 2011 12:07:48 pm by Sergi A

Monday 30 May 2011 2:51:07 pm

I cannot understand aht you are trying to do, really. What I'd go for:

  • same content database: use four siteaccesses (or more) in one ezpublish installation. Different domain names pose no problem. You could even have two sets of users, one group logging to site A, the other logging to site B (and two anon users, with different policies on the different sites)
  • two separate databases: use separate var directory, one ezp install, or
  • two separate databases: use two ezp installs, share kernel/extension php code by symlinking common directories

Monday 30 May 2011 5:09:54 pm

I'm trying to solve this by using the same installation but different siteaccesses. So, now i have both websites in 4 different languages, then i need 8 different siteacces conifugrations? Also, 4 of them should work on a different domain.. is it possible? how should i do it?

Wednesday 08 June 2011 4:23:03 pm

Hi Sergi.

What you are trying is perfectly doable with ez publish. about the var thing, as said by the other guys, it's up to you to decide if you want one only database or one database per domain or per siteaccess. but if two siteaccess share db, they should share the same var folder.

i don't understand why you need cache1 folders and things like that...

maybe if you can add some sample of what are trying to achieve we can help a bit more... i mean... something like

i need domain1.com in english and spanish, domain2 only german... or whatever...

also it would be good to know if even they are different domains they share content (i mean, domain.de is the translated version or domain.co.uk, for example)

cheers.

Wednesday 08 June 2011 4:25:57 pm

Btw, i would like to add something about this related to the install process. when you run the ez publish install process, and you select a common "one public siteaccess and one admin siteaccess" installation, you end having DatabaseSettings in both siteaccess/[siteaccess]/site.ini.append.php ... but FileSettings are placed in settings/override/site.ini.append.php.

Sometimes i tried to change var folder for one siteaccess and it doesn't work until you realized that setting is in setting/override/file.ini.append.php too...

Cheers.

Monday 04 July 2011 1:12:42 pm

We have different 2 ez publish installations sharing database.. we need, then, to share the var directory, so we are trying to create a soft link on the server from one var folder to the var folder of the other installation.

We are getting some problems with it, the main one being that we are unable to set different caches folders for each installation. Looking at the ez doc it seems that it is possible to set up differnet cache folders via site.ini, something like:

[FileSettings]
VarDir=ln_to_var
CacheDir=cache_folder_inside_var

But this is not working, the caches are being shared for the two insatallations, and we need each one to have itself caches.

I had a similar issue today, and here's what I figured out...

If your 2 installations are sharing the var dir, they will also be sharinf the global cache dir "var/cache". Therefore some INI settings you set on one installation will be used from the cache by the other installation too. And therefore, in this case both installation would use the same value for the CacheDir.

I'm not sure if all ini settings are cached here, but the ones from settings/override definitely are.

Maybe this doesn't mean much to you now, but just in case someone encounters this thread...

Modified on Monday 04 July 2011 1:19:01 pm by Mavko Žmak - Žmale

Monday 04 July 2011 1:36:42 pm

Now that I think about it...

It seems like the thing you were trying to do originally, is not doable. The CacheDir ini setting will always be cached in the global cache dir "var/cache" or in the standard cache dir of siteaccess "var/<siteaccess>/cache". Because it's actually this setting that defines the cache dir to be used for the siteaccess. And therefore, all caching done prior to reading this variable has to be put in one of this folders that are used by both of your eZP installation.

So it seems like two eZP installations that share the same var folder cannot have different cache folders for the same siteaccess.

I know I said before that I have done it many times, but now I remember that in such cases I was always using different siteaccess on each installation.

P.S. Maybe implementing a feature like this could be proposed as an enchancement...

Monday 04 July 2011 2:18:30 pm

Marko, what you said has sense to me.. that's why I used to found that the first domain to be refreshed after clearing caches would be the one remaining, and things like the breadcrumbs which is cached, would remain the same for both domains..

I started working on different siteaccesses, and it seems i will have to go on with this solution sad.gif Emoticon

 

thank you!

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from