Multisite on one installation
This page is for hosts and administrators who run several sites from one Exponential installation, or who must decide whether to. It answers: how siteaccesses work, what the host has to configure, how logs and caches can be kept per site, and when separate installations are better.
Contents
- Siteaccesses in short
- Matching by URL, host or port
- Logs and caches per site
- One installation or several?
Siteaccesses in short
"A siteaccess is one way into the installation: a name, a set of settings in settings/siteaccess/<name>/, and a
rule for which requests it answers" (10.2).
The installer creates at least the public siteaccess and the administration (and an editor siteaccess with
exp:install). More public siteaccesses can serve more sites, languages or designs from the same content repository.
The site package sevenx_multisite is built for this ("7x MultiSite Default Installation"; Site packages).
Matching by URL, host or port
The rules live in site.ini [SiteAccessSettings]; MatchOrder is uri;host;port as shipped.
| Layout | Example | For a host |
|---|---|---|
| URL | www.example.com/admin | one host name, simplest behind any web server |
| Host | admin.example.com | "best for production and for HTTPS certificates per host" |
| Port | :8081 | local work |
Host matching, as in 10.2:
# settings/override/site.ini.append.php
[SiteAccessSettings]
MatchOrder=host;uri
HostMatchType=map
HostMatchMapItems[]
HostMatchMapItems[]=www.example.com;site
HostMatchMapItems[]=www.example.org;site_org
HostMatchMapItems[]=admin.example.com;adminEach siteaccess sets its own [SiteSettings] SiteURL. Add every host name to the web server or Velocity, to DNS and
to the certificate, clear the INI cache (php bin/php/ezcache.php --clear-tag=ini --allow-root-user) and test that
each name reaches the right siteaccess. "The host name the browser sends must be exactly the one in
HostMatchMapItems[], without a port and in lower case."
Behind a proxy or load balancer, list it in site.ini [HTTPHeaderSettings] TrustedProxies[], or the site sees the
proxy's scheme and address (10.2).
Logs and caches per site
When each site has a VarDir of its own, these site.ini [FileSettings] settings keep its files apart
(Logs, INI cache and expiry timestamps per site):
| Setting | Default | Effect |
|---|---|---|
UseGlobalLogDir | enabled | disabled writes the debug logs into the log directory of the site instead of var/log |
LogVarDir | empty | a tree for the logs of every site, var_log/<site>/log |
CacheVarDir | empty | a tree for the caches of every site, var_cache/<site>/cache (for example on a memory file system) |
INICacheDir | global | site caches each site's INI files in its own cache directory, so clearing one leaves the others alone |
"Every setting keeps the behaviour of before" unless you set it. Settings per site inside extensions are described in Per-site settings inside extensions.
One installation or several?
| One installation, several siteaccesses | One installation per site | |
|---|---|---|
| Shared content and users | yes | no |
| One update for all sites | yes | one per site |
| Operating-system isolation between sites | no: one system user, one code base | yes (Multi-tenant isolation) |
| One customer's load affects the others | yes | no, with separate pools or instances |
| Backups and restores | together | per site |
| Billing "per site" | define what a site is (Billing and metering options) | simple |
Rule of thumb for a host: several siteaccesses on one installation for one customer with several sites; separate installations for different customers.
Related pages
- Site packages
- Multi-tenant isolation
- Chapter 10: After installing
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.