Web & search stack internals
The web-serving half of BOA: how Provision turns an Ægir site node into an Nginx vhost and settings.php, where the edge-map wall is declared, and how Barracuda installs Solr.
The web-serving half of BOA: how Provision turns an Ægir site node into an
Nginx vhost + a settings.php, where the edge-map wall that fronts every
request is declared, and how the Barracuda installer lays down the Solr search
backends those vhosts talk to.
Two languages meet here — the vhost/settings generator is Drush 8 / PHP 5.6-floor PHP inside the Provision fork, the Solr installer is Barracuda-side bash inside boa-private — and a change on either side has to survive the other's assumptions.
If you touch server.tpl.php, a settings template, or solr.sh.inc, this is
the wiring your change lands in.
The render pipeline in one pass
Every Nginx config file BOA writes goes through the same Provision_Config
machinery, driven by the nginx service class
(Provision_Service_http_nginx, http/Provision/Service/http/nginx.php:3).
init_server() registers which config classes render at server vs site scope
(nginx.php:23-25,39-40), and save_server()/verify_server_cmd() probe the
running box — nginx -V feature flags, socket-vs-port PHP-FPM mode, the
/data/conf/global.inc BOA-mode marker — and stash the results as server
properties the templates read (nginx.php:44-160).
Each registered class is a Provision_Config subclass whose write() runs the
fixed cycle in the base (Provision/Config.php:195):
process()populates$this->data.load_template()resolves the.tpl.php(through theprovision_config_load_templates[_alter]hooks,Config.php:117-160).render_template()eval('?>' . $template)s it with$thisand$datain scope (Config.php:169-186) beforefile_put_contentswrites the file.- Then
Provision_Config_Http::write()->sync()s it to the target server (http/Provision/Config/Http.php:10-13).
The three server/site classes and what they emit:
| Class | Template | Renders to | Contains |
|---|---|---|---|
Provision_Config_Nginx_Server (Nginx/Server.php) |
server.tpl.php |
<config_path>/nginx.conf (Http/Server.php:21-24) |
the http-block edge maps + limit_*_zones |
Provision_Config_Nginx_Inc_Server (Nginx/Inc/Server.php) |
Inc/vhost_include.tpl.php |
<include_path>/nginx_vhost_common.conf (Http/Inc/Server.php:41-44) |
the per-request guard chain every vhost includes |
Provision_Config_Nginx_Site (Nginx/Site.php) |
vhost.tpl.php (vhost_disabled.tpl.php when down) |
<http_vhostd_path>/<uri> (Http/Site.php:13-19,37-39) |
the site server block, DB creds, include nginx_vhost_common.conf |
The SSL variants (Nginx/Ssl/*, registered by nginx/ssl.php) render the
quic-enabled listeners; the subdir feature adds Provision_Config_Nginx_Subdir
_SubdirVhostonly whenprovision_hosting_feature_enabled('subdirs')(nginx.php:37-41). All of them extend the same base, so the pipeline above is invariant — only the template andfilename()change.
Both server-scope classes also splice in drush_command_invoke_all('provision_nginx_server_config', …) / _vhost_config output (Nginx/Server.php,
Nginx/Site.php), the extension seam documented on the
Ægir backend APIs topic — that is how a hosting_* module
injects config without editing a template.
Where the four leaves sit
Aegir site node ──(verify task)──▶ Provision http service
│
┌────────────────────────────────────┼───────────────────────────────┐
│ server.tpl.php (once per server) │ vhost.tpl.php / vhost_ssl │ settings template
│ http { ... maps + geo + zones } │ (once per site) │ (once per site)
│ $is_banned, $is_cms_probe, │ server { listen; server_name;│ settings.php:
│ $is_ai_*, $cache_uid, │ fastcgi_param db_* creds; │ literal db creds,
│ $boa_i18n_* ... │ include nginx_vhost_common }│ global.inc chain,
│ ↓ [1 edge maps] │ ↓ [2 vhost generator] │ local.settings.php
│ Inc/vhost_include.tpl.php │ │ ↓ [3 settings wiring]
│ guard chain: if ($is_*) return 444│ │
└────────────────────────────────────┴───────────────────────────────┘
│
php-fpm ──▶ Drupal ──▶ Search API / Solr
↑ [4 Solr installer: solr.sh.inc]
- [1] Edge maps are declared in
server.tpl.php(http scope, once per server) and enforced invhost_include.tpl.php(per request, in every vhost). Splitting declaration from enforcement is deliberate: a map is a cheap constant-time lookup, so the guard chain is a flat list ofif ($is_x) return 444;with no per-request regex. - [2] The vhost generator is
vhost.tpl.php/Ssl/vhost_ssl.tpl.phpplus theProvision_Config_Nginx_*classes that render them — the per-site server block, the DB-credfastcgi_paraminjection, and theincludethat pulls in the shared guard chain. - [3] settings.php wiring is the Drupal-side companion: BOA writes the DB
creds literally into
settings.php(BOA turns Ægir's$_SERVERdb-cloaking off —cloaked_db_creds()returns FALSE), plus the three-levelglobal.inc→ platform →local.settings.phpinclude chain. - [4] The Solr installer is Barracuda-side bash —
solr.sh.inclays down the Solr 4/7/9 backends and their JVM/service wiring that Search-API vhost traffic ultimately reaches.
Hold that picture; each leaf zooms into one box.
Adjacent developing topics
- Ægir backend APIs — the
provision_nginx_server_config/provision_nginx_vhost_config/provision_drupal_confighooks these templates invoke, and the Provision template-alter chain ahosting_*extension uses to add config without patching a.tpl.php. - Install & staged-setup internals — how the
Provision codebase (and the Solr backends) get onto a box in the first place:
the staged
AegirSetup*engine and the/opt/tmp/make_localbuild tree. - Monitor & abuse-guard internals (code) — the
scan_nginxscorer that reads the access log these vhosts write and reacts to the444s the guard chain and the$boa_i18n_anoncap emit; the ban decisions it makes land back in the$is_bannedgeo declared here.
Reference
- Variables and
Commands — the consolidated
_VARand CLI tables, including the_SOLR_*/_JETTY_*/_XTRAS_LISTknobs the installer reads. The Nginxmapvariables ($is_banned,$is_cms_probe,$boa_i18n_*,$cache_uid, …) are deployed-vhost contract surface: add, never rename or remove. - Discontinued features — retired search/web pieces (older Solr/Jetty generations, superseded template mechanics) land there; check it before documenting anything found only in old trees or logs.
Vhost generator (Provision templates)
How Provision renders the per-site Nginx vhost: the Provision_Config eval cycle, the server, inc and site class split, the disabled, subdir and SSL variants, and where it lands.
Edge map/geo mechanics & the never-remove rule
The http-block map and geo catalogue that filters every request: the declare-here enforce-there idiom, the ban, crawler and i18n maps, and why a deployed map can never be removed.
How BOA wires settings.php (global.inc)
How Provision generates the settings.php: the per-major template, the BOA switch writing literal DB creds, and the global.inc to platform to local.settings.php include cascade.
Solr installer internals (solr.sh.inc)
The Barracuda-side dispatcher that installs Solr 4, 7 and 9: the three version ladders, their gating tokens, the JDK-pinned env files, and why it runs only on an UPGRADE pass.