Multiple Sites with One eZ installation. ( Potential Problems on the horizon )

Author Message

Chris Williams

Monday 13 September 2010 3:35:28 am

Multiple Sites with One eZ installation. ( Potential Problems on the horizon )

  1. Autoload is not site specific.
  2. Log files are not written based on individual sites.

Autoload is not site specific.
Each site may require different classes from different extensions, yet they might be using the same class name or file name. Equally, with the creation of the var directory for each siteaccess. It makes sense that the autoload should be found with in that var directory.
Part of the problem is telling the system which autoload to include, due to the siteaccess being discovered in "index.php" after some classes have initially been loaded.
Another part of the problem, "ezautoloadgenerator.php" the creation of the mapping array, doesnt have a way to know which siteaccess to use. Equally it doesnt know where to then save the new siteaccess specific "ez_kernel.php". ie within the "VarDir" value in the "site.ini.append.php".
The trickiest part will be figuring out how to deal with the "index.php".

Log files are not written based on individual sites.
The way eZDebug is set up, at present. The paths to the log file locations are hardcoded into the public variable "LogFiles". A hack would be to override this public variable with a SiteAccess specific location for each of the logs. A better solution would be to add another method to eZDebug to do this for us, similar to the eZDebug::updateSettings().

Peter Rudolfsen

Monday 13 September 2010 3:36:51 am

Just wanted to say that I'm backing this up, and are potentially big issues with having loads of site in the same installation.

I'd really love to see some kind of standalone, pluggable, library version of eZ Publish that you could easily add new sites to without copying all of the needed libraries and such.

Gabriel Finkelstein

Monday 13 September 2010 10:02:16 am

I would also add that modifying the template look (Design >> Look) modifies the global settings instead of a specific siteaccess.

Chris Williams

Tuesday 14 September 2010 2:19:44 am

Hi Gabriel,

Im not entirely sure what you mean. A combination of writing extensions and linking to them in your siteaccess allows you to create designs specific to any siteaccess and not globally. Yet as a fall back if your design is missing a template it will fallback to default eZ templates. If this is not what you mean, please could you explain a little more.

A semi example.

#in siteaccess settings/site.ini.append.php

[DesignSettings]
SiteDesign=unique_site_design_extension

AdditionalSiteDesignList[]
AdditionalSiteDesignList[]=unique_site_design_extension
AdditionalSiteDesignList[]=ezwebin
AdditionalSiteDesignList[]=base

If you create an extension with your design in. Within your extension you need to add the following ini settings to make it work.

# in EXT settings/design.ini.append.php

[ExtensionSettings]
DesignExtensions[]=unique_site_design_extension

SEBBANE Alexandre

Saturday 18 September 2010 8:33:52 pm

Hello,

when you say "Multiple Sites with One eZ installation. ( Potential Problems on the horizon )" do you mean 1 install of Ez and One database or one install and many database.

for both case :

  • as the install of ez is unique, as soon as you have an error in an extension, it will generate logs : so why do you want to separate logs : it is easier to see it and correct ot.
  • for autoloads the autoloads files is hsut an array but it means tahats you have to do good code which take contasnt from your current siteaccess.

For me , as i use it evreyday in my intranet websute factory, your two issues are not so potentials problems but goods solutions to have feedback in one file ( as we speak of the logs issues).

i hope my point of view will answer your questions

Paris, France

Chris Williams

Tuesday 21 September 2010 12:26:11 am

Hi Alexandre,

I do mean one install of eZ and its extensions and different databases per site.

When you have more than one site logging to the same log files, there is no easy way to distinguish which site created that error. Of course this is greatly reduced when your working on a site.

Of course what im trying to discuss is not an everyday case, but with the potential push in using eZ to manage multiple sites under the one install, I was just highlighting some of the little things I have been dealing with.

Im not 100% sure what you are saying in your response regarding the autoloads.

If we have two extensions, but one had to be tweaked. So we either alter the class or create a new extension called before the other to override that class.

How does the autoload know which one site "a" needs loaded and which one site "b" needs loaded.

Based on how you use eZ on an intranet, I suspect the problems outlined in my first post will ever be an issue for that installation.

Thank you for taking time in joining the conversation.

Russell Michell

Monday 04 October 2010 12:01:58 am

Hi Chris,

You are certainly correct in as far as running multiple "sites" off a single install isn't trivial. I spent months figuring it out and have got it nailed.

What's worse is the number of different ways there are of doing it and no authoritative documentation explaining the procedure.

One point where you are perhaps not 100% with is with separate logging.

If you employ the extension-siteaccess method, where each extension is a new "site", you simply edit the site.ini for each one and ensure you edit the LogDir settings for each, so you have a nice logging dir hierarchy under var/log/<your_site>/error.log (for example) see here: http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/FileSettings

There are of course decisions to be made about multiple databases. I went for a single DB and multiple extensions which is working well. I used a single DB because the sites were related and shared the use of the same custom-tags. So changing the value of a setting that a custom-tag in another site relies on, means it is updated everywhere it is used, regardless of which site it's in.

I'm not sure what you mean about having to alter a class for an extension. If you're talking simple design extensions, then there is no need for separate classes. If you want to have some specific OO functionality called from each extension, think of the problem differently: Why not create a separate extension soley for this class and in the classes logic, differentiate between siteaccesses on that level instead - if that makes sense?

Cheers
Russ

Russell Michell, Wellington, New Zealand.
We're building! http://www.theruss.com/blog/
I'm on Twitter: http://twitter.com/therussdotcom

Believe nothing, consider everything.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:03:35
Script start
Timing: Jan 18 2025 02:03:35
Module start 'layout'
Timing: Jan 18 2025 02:03:35
Module start 'content'
Timing: Jan 18 2025 02:03:36
Module end 'content'
Timing: Jan 18 2025 02:03:36
Script end

Main resources:

Total runtime0.7021 sec
Peak memory usage4,096.0000 KB
Database Queries76

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 592.2578152.6875
Module start 'layout' 0.00700.0033 744.945339.5234
Module start 'content' 0.01020.6902 784.4688723.5469
Module end 'content' 0.70050.0016 1,508.015620.0625
Script end 0.7021  1,528.0781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.4928160.0002
Check MTime0.00150.2084160.0001
Mysql Total
Database connection0.00080.113910.0008
Mysqli_queries0.618388.0695760.0081
Looping result0.00160.2212740.0000
Template Total0.670395.520.3351
Template load0.00210.303020.0011
Template processing0.668195.158020.3341
Template load and register function0.00020.022510.0002
states
state_id_array0.00080.111410.0008
state_identifier_array0.00120.172920.0006
Override
Cache load0.00170.2410720.0000
Sytem overhead
Fetch class attribute can translate value0.00060.089750.0001
Fetch class attribute name0.00180.2595100.0002
XML
Image XML parsing0.00340.482450.0007
class_abstraction
Instantiating content class attribute0.00000.0026100.0000
General
dbfile0.00250.3604280.0001
String conversion0.00000.001640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
16content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ol.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ol.tplEdit templateOverride template
6content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 44
 Number of unique templates used: 11

Time used to render debug report: 0.0001 secs