Lesson 3.6: Multisite, practical task
A second site starts with a matching rule. In this task the learner reads how their training installation finds its siteaccesses, switches it to host matching with test host names, proves the result from the shell without touching DNS, and puts everything back. A short written recommendation checks the judgment part of the course.
Note
This is the trainer's own assessment, not an official certification. Learners change the settings of their own
training installation only. The test host names end in .test, which never reaches the public internet.
At a glance
| Course | Assessments and practical exercises |
| Module | Module 3: Assessing the administration courses |
| Duration | 75 minutes (5 briefing, 50 task, 20 scoring) |
| Level | Advanced |
| Audience | Learners at the end of the Multisite and site packages course |
| Prerequisites | Lesson 3.5; a shell on the learner's own training installation, served on a local port |
Learning objectives
Learners who pass this task have shown that they can:
- list the siteaccesses and matching rules of an installation;
- configure host matching with a host map and the matching
SiteURLvalues; - prove which siteaccess answers a host name with
curl; - back up and restore settings files safely;
- recommend one installation or several for a given case, with reasons.
Trainer's notes
How to run it
- Before: one training installation per learner, installed with URL access (the default), served on a local port as in Serving the lab sites. Note the names of the public and admin siteaccesses of the site package you use.
- Briefing: hand out the steps and the rubric; 50 minutes.
- Scoring: read the learner's notes with the
curloutputs, and check that the settings files match their backups at the end.
Common questions
Why curl -H 'Host: ...' and not a browser? The header lets the learner choose the host name without editing DNS
or the hosts file of the machine. The installation sees the same thing a browser would send.
Does Velocity need a restart after the change? If the site is served by Velocity, yes: it keeps settings in memory (Caches). Count it as part of step 6.
Pitfalls
- Overwriting the override file. Learners must back it up first (step 2). Restoring from the backup is scored.
- Upper case or a port in the map. The host name must match exactly, in lower case and without a port; a typo gives the same siteaccess for both names, which is a good teaching moment.
Hands-on exercise
The task, as handed to learners. Work in the installation root of your own training installation; write down every command and its output.
List the current siteaccess settings:
./console exp:ini list site.ini/SiteAccessSettings --allow-root-userWrite down
MatchOrder,AvailableSiteAccessList[]and which siteaccess is public and which is the administration.Back up
settings/override/site.ini.append.phpand the twosettings/siteaccess/<name>/site.ini.append.phpfiles of the public and admin siteaccess to a directory of your own undervar/.Add host matching to
settings/override/site.ini.append.php, keeping URL matching as a fallback:[SiteAccessSettings] MatchOrder=host;uri HostMatchType=map HostMatchMapItems[] HostMatchMapItems[]=www.training.test;<public siteaccess> HostMatchMapItems[]=admin.training.test;<admin siteaccess>Set
[SiteSettings] SiteURLtowww.training.testin the public siteaccess's file andadmin.training.testin the admin siteaccess's file.Clear the INI cache:
php bin/php/ezcache.php --clear-tag=ini --allow-root-user.If the site runs on Velocity, restart it. Then test both names against your local port:
curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' -H 'Host: admin.training.test' http://127.0.0.1:<port>/ curl -s -o /dev/null -w '%{http_code}\n' -H 'Host: www.training.test' http://127.0.0.1:<port>/Test an unlisted name,
-H 'Host: other.training.test', and write down which siteaccess answered and why.Write a recommendation of five to eight sentences for this case: A school runs a main website and a separate site for its alumni association. The same staff edit both, and the alumni site reuses news items from the main site. One installation with two siteaccesses, or two installations?
Restore the three files from your backups, clear the INI cache (restart Velocity if it serves the site), and check that
MatchOrderis back to what you noted in step 1.
Expected result
- Notes with the original settings, the backups' location and the
curloutputs. - The admin host answered with a redirect to the login page (or the login page), the public host with
200; the unlisted name fell back to URL matching and reached the default siteaccess. - A recommendation for one installation with two siteaccesses, because content and editors are shared, mentioning what would change the answer (separate customers, isolation, separate backups).
- After step 9,
MatchOrderandSiteURLare as they were.
Scoring rubric
| Criterion | 0: Not shown | 1: Partly | 2: Mostly | 3: Fully | Evidence |
|---|---|---|---|---|---|
| Reading the setup | Nothing noted | MatchOrder only | Siteaccesses noted, roles unclear | MatchOrder, list and roles noted | The notes |
| Host map and SiteURL | Not written | Map with errors (case, port) | Map right, SiteURL missing | Map and both SiteURL values right | The settings files (before restore), the notes |
| Proof with curl | No test | One host tested | Both tested, unlisted name not explained | Both tested, fallback explained | The curl outputs |
| Recommendation | Missing | Answer without reasons | Reasons, no condition that would change it | Reasons and the conditions that would change it | The text |
| Backup and restore (must) | No backup | Backup, not restored | Restored, cache not cleared | Restored, cache cleared, checked | The notes, exp:ini list |
Pass: 10 of 15 points or more and Backup and restore at 2 or 3.
Quiz
Debrief questions to ask after scoring.
- Why did
MatchOrder=host;urikeep the site working for addresses not in the map? - On a real server, what else must know the new host names?
- What would you add if the site sat behind a proxy on another machine?
- Which setting would you change if each site needed its own INI cache?
Answers
- When no host matches, the next method,
uri, is tried (10.2). - The web server or Velocity, DNS and the certificate (Multisite on one installation).
- Its address in
[HTTPHeaderSettings] TrustedProxies[](10.2). [FileSettings] INICacheDir=site(Multisite on one installation).
Further reading
- 10.2 Siteaccesses and site addresses: the commands used in the task.
- Multisite on one installation: the decision table.
- Site packages: installing a multisite package from the start.
Related pages
- Lesson 3.5: Multisite, written test
- Module 3: Assessing the administration courses
- Assessments and practical exercises: course overview
- Trainers: start here
- 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.