Multi-site
Many first-class domains on one lazysite instance, with one login.
Multi-site
One lazysite instance serves many domains (SM110/SM151). Each domain is rooted at its own content subtree and is, to the outside world, a complete site - its own home page, navigation, theme, canonical URL, sitemap, feeds and search. Behind the scenes there is one docroot, one auth store, one manager and one MCP endpoint. Each account and each AI credential reaches the domains it is allowed (see Domain delegation).
Configuration
Domains are declared in lazysite.conf: alias_hosts lists the served
hosts, and alias.<host>.<key> lines override per host. The Domains
manager page and the lazysite-domains CLI write the same lines.
site_name: Agency Home
alias_hosts: clienta.example, clientb.example
alias.clienta.example.site_name: Client A
alias.clienta.example.content_root: sites/clienta
alias.clienta.example.site_url: https://clienta.example
alias.clienta.example.theme: harbour
alias.clienta.example.nav_file: sites/clienta/nav.conf
Only a fixed whitelist of keys may vary per host. The presentation and
routing keys are site_name, theme, layout, nav_file,
search_default, content_root, site_url, lang and lang_group. A
domain may also carry its own Content Security Policy allow-lists
(csp_script_src, csp_connect_src, csp_img_src, csp_frame_src)
and its own installable-app settings (the app_* keys, such as
app_name, app_scope and app_icon_192). The Host header is
request-supplied, so security-relevant keys (auth, manager, WebDAV,
update) stay instance-wide, and an undeclared or malformed host gets
the base configuration.
Per-domain content roots
content_root names a docroot-relative directory that becomes the
domain's /. The boundary is enforced at request time: the root must
resolve (symlinks included) inside the docroot and outside the
lazysite/ management tree. An invalid root degrades that one host to
the docroot with a warning, so one bad entry leaves the rest of the
instance and its siblings' trees untouched. A host declared without a
content_root serves the default site.
Domain aliases
A second host can serve an existing domain's content root: the
domain-alias-add action (or Add domain with "The same content as"
on the Domains page) registers it with the same content_root. An
alias keeps its own name and presentation keys, while its canonical
links, sitemap, feeds and llms.txt use the canonical domain's
site_url; layouts read that address as canonical_url. A host with
no content root of its own is an alias of the default site. See
Domain aliases.
Per-domain registries, search and cache
- Sitemap, robots, feeds and
llms.txtare generated per content root, written into that root, using the domain's ownsite_url - Search (
scan:sources) is boxed to the requesting domain's root, so a search on one domain returns only that domain's pages - A host with no root of its own scans the whole docroot but skips every declared content root, so the default host leaves client subtrees out of its listings
- The render cache is host-keyed - each domain reads and writes its own cache slot, listed and cleared per host on the Cache page
The shared management plane
The lazysite/ tree (config, auth, ACLs, themes, layouts, logs,
backups) exists once and is shared by every domain. The operator
manages every domain and sees every subtree in the file browser.
Accounts and agents confined to some domains (see
Domain delegation)
see and change only those domains, and are refused instance-wide
actions on every surface (since 0.15.3).
Themes and layouts are shared across domains. A confined account
writes into a theme or layout only when no other site serves it; to
change a shared one it copies it, edits the copy and activates the copy
on its own domain with host (since 0.15.4).
The first-party access log records the request Host. Visitor analysis
(analyse_visitors) reads one domain with host or splits the traffic
with by_host, and a confined caller sees only its own domains'
traffic.
Web-server static rewrites
Rendered pages route through the processor, which also serves each
domain's static files from its content root. For production efficiency
the vhost tools generate per-Host rewrite rules from lazysite.conf, so
the web server serves each domain's real static files (images, CSS,
sitemap, feeds) directly from its subtree:
lazysite-apache-vhost rewrites --docroot /path/to/public_html
lazysite-nginx-vhost rewrites --docroot /path/to/public_html
Apache gets a mod_rewrite block (fires only when the file exists);
nginx gets a map $http_host plus a try_files line. Clean page URLs
and the /lazysite, /cgi-bin and /manager surfaces still flow to
the processor.
Notes
- A bare docroot with no configured roots behaves exactly as a single-site install - multi-site is a pure superset
- DNS, the web-server alias and TLS remain operator territory; lazysite owns only the conf and the content root
[% domain %]exposes the sanitised host to layouts, so one content root can still render differently per domain- Taking a client in-house is a move: copy the subtree to a fresh instance and repoint DNS, or move the domain with a site package