Site management
One Exponential installation can run several sites, and several faces of one site, with the siteaccess system. A siteaccess is a named set of settings that is applied on top of the defaults when a request matches it. It decides, among other things, which database, design, languages and var directory are used, whether visitors must sign in and which part of the content tree is shown.
The siteaccesses of a new installation
| Siteaccess | For | Typical settings |
|---|---|---|
| site | Visitors | The site's own design; RequireUserLogin=false; ShowHiddenNodes=false |
| admin | Administrators | An administration design such as admin4l or admin4; RequireUserLogin=true; ShowHiddenNodes=true |
| editor | Editors: the administration for content only | SiteDesign=editor, falling back to the administration designs |
All three use the same database and var directory, so they show the same content in different ways. That is the usual shape: one public siteaccess per site or language, plus the administration.
Where a siteaccess is defined
- Its name is listed in site.ini [SiteAccessSettings] AvailableSiteAccessList[], in settings/override/site.ini.append.php.
- Its settings are in settings/siteaccess/<name>/, as .ini.append.php files: site.ini.append.php at least, often also content.ini, override.ini, design.ini and image.ini.
- How requests reach it (by path, host or port) is set in [SiteAccessSettings] too; see Access methods.
- Extensions can carry settings for it; see Extension siteaccess settings.
<?php /* #?ini charset="utf-8"? # settings/siteaccess/site/site.ini.append.php [SiteSettings] SiteName=Example SiteURL=www.example.com DefaultPage=/content/view/full/2/ LoginPage=embedded [SiteAccessSettings] RequireUserLogin=false RelatedSiteAccessList[] RelatedSiteAccessList[]=site RelatedSiteAccessList[]=admin ShowHiddenNodes=false [DesignSettings] SiteDesign=mydesign AdditionalSiteDesignList[] AdditionalSiteDesignList[]=base [RegionalSettings] Locale=eng-US ContentObjectLocale=eng-US SiteLanguageList[] SiteLanguageList[]=eng-US */ ?>
Settings that make a siteaccess
| Setting | Meaning |
|---|---|
| [SiteSettings] SiteURL, SiteName | The address used in links and e-mail, and the site's name. |
| [SiteAccessSettings] RequireUserLogin | true: anyone not signed in is sent to the login form (administration); false: anonymous visitors may browse what their role allows. |
| [SiteAccessSettings] RelatedSiteAccessList[] | The siteaccesses that share this one's database; caches and links are handled for all of them. |
| [SiteAccessSettings] ShowHiddenNodes | Whether hidden content is shown. See Node visibility. |
| [DesignSettings] SiteDesign, AdditionalSiteDesignList[] | The design and its fallbacks. See Designs. |
| [RegionalSettings] | The languages. See Multiple languages. |
| [DatabaseSettings] | A siteaccess can use a database of its own; usually the global one is used. |
| [FileSettings] VarDir | Where its files, caches and logs go, for example var/site. |
Who may use a siteaccess is decided by the policy user/login, which can be limited by siteaccess: a role can let a group sign in to the administration and not to the public site, or the other way round. See Access control.
The setup wizard creates the first siteaccesses; more can be added by hand as above. Configuring Exponential 6.0 section 3 shows complete examples.
In this section
Contributors
- Balazs Halasy
- Geir Arne Waaler
- Josh Luo Commenter
- Kyle Lady Commenter
- JB Commenter
- Daniele P. Commenter
- Kristian Hole Commenter
- Gunnstein Lye Commenter
- Svitlana Shatokhina Commenter
- Alva Commenter
- Graham Brookins Updated Maintainer
Comments (9 historical)
Written by readers of the earlier documentation sites, kept as they were.
Sequence of the override files
Josh Luo ·
When a siteaccess is in use, it seems more LOGIC for eZ publish to read the configuration files using the following sequence:
1. Default configuration settings (/settings/*.ini)
2. Global overrides (/settings/override/*.ini.append.php)
3. Siteaccess settings (/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
I think, for example, that the database settings in the global override directory SHOULD be overrided by the database settings in the siteaccess. Otherwise if we have several databases for multisites, the different databases settings in the different siteaccess are overrided by the same database sittings in the global overrides, some sites would't work.
Re: Sequence of the override files
Kyle Lady ·
"I think, for example, that the database settings in the global override directory SHOULD be overrided by the database settings in the siteaccess. Otherwise if we have several databases for multisites, the different databases settings in the different siteaccess are overrided by the same database sittings in the global overrides, some sites would't work."
In that case, you should not use the global override to set the database settings. You would have to set the database settings in every site's siteaccess file.
Re: Re: Sequence of the override files
Josh Luo ·
Supposing multisites include many sites with the same database, for instance, 10 sites. I can set the database db in the global overrides only one time. Some day I want to site1 with a separate database db1. How can I do?
According to your sequence to read the configuration files:
1. Default configuration settings (/settings/*.ini)
2. Siteaccess settings (/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
3. Global overrides (/settings/override/*.ini.append.php)
I have to:
--- set the db1 in this siteaccess setting file for site1;
--- delete the db settings in the global override file, or db1 will be overrided by db settings;
--- set the same db one by one in other siteaccess setting files, 9 files for this example.
But according to the following sequence to read the configuration files:
1. Default configuration settings (/settings/*.ini)
2. Global overrides (/settings/override/*.ini.append.php)
3. Siteaccess settings (/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
I only need set the db1 in this siteaccess setting file for site1, that's all.
I needn't delete the db settings in the global override file, because the db will be overrite by db1. Also I don't worry about other sites. Do nothing for other 9 sites.
Think about other setting parameters, there is the same situation. That's why I think the latter seems more LOGIC.
Re: Re: Re: Sequence of the override files
JB ·
I'm sorry but I'm not agree with you, because as kyle says, you can solve your problem by deleting database settings in the global override and managing this settings per site access.
On the other side I have exactly the opposite need, and you couldn't find a solution if global settings are overrided by siteaccess settings :
I need to allow my siteaccess owners to modify their templates and settings (including site.ini) but I don't want they use another database, and I don't want they know my database password. They must use the same database for all siteaccesses.
It's just a different LOGIC ! ;-)
You may add more info about extension
Daniele P. ·
You can place a lot of common settings in a common extension:
Smart example (for sites with only different lang):
$ cat settings/siteaccess/en/site.ini.append.php; echo
<?php /* #?ini charset="iso-8859-15"?
[ExtensionSettings]
ActiveAccessExtensions[]=in_common
ActiveAccessExtensions[]=in_lang_en
*/ ?>
$diff -Naur extension/in_lang_en/settings/site.ini.append.php extension/in_lang_de/settings/
--- extension/in_ber_lang_en/settings/site.ini.append.php 2005-09-30 15:32:34.000000000 +0200
+++ extension/in_ber_lang_de/settings/site.ini.append.php 2005-09-30 15:33:13.000000000 +0200
@@ -1,16 +1,16 @@
<?php /* #?ini charset="iso-8859-15"?
[SiteSettings]
-SiteName=[en]
+SiteName=[de]
-SiteURL=http://www.example.it/en
+SiteURL=http://www.example.it/de
[RegionalSettings]
-Locale=eng-US
-ContentObjectLocale=eng-US
+Locale=ger-DE
+ContentObjectLocale=ger-DE
TextTranslation=enabled
[ContentSettings]
Extensions
Kristian Hole ·
Here the information about extensions are missing. This is the correct order when using settings in extensions:
1. Default configuration settings (/settings/*.ini)
2. Siteaccess settings (/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
4. Ative Extensions (/extension/*/settings/*.ini.append.php)
3. Global overrides (/settings/override/*.ini.append.php)
Extensions update
Gunnstein Lye ·
This is the order, including extension site accesses:
1. Default configuration settings (/settings/*.ini)
2. Active extension siteaccesses (/extension/*/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
3. Siteaccesses (/settings/siteaccess/[name_of_siteaccess]/*.ini.append.php)
4. Active extensions (/extension/*/settings/*.ini.append.php)
5. Global overrides (/settings/override/*.ini.append.php)
Re: Extensions update
Svitlana Shatokhina ·
Agree, added an issue http://issues.ez.no/12939 for this, it's on our todo list.
Question about the loading sequence
Alva ·
If i set the HostMatchItems or AvailableSiteAccessList in globle override, and the globle override is loaded after the siteaccess.
How can EZ know which siteaccess should be loaded?