Testing and Launch
Learning Website: Framework & Architecture
Chapter 12 ยท Testing, Launch & Operations
A design is only as good as the checks that prove it works and the routine that keeps it working. This last chapter gathers the tools from the whole course into a launch gate, adds the one test that has been missing (following every link in the built site), looks at size and cost, and sets out what to watch after launch and what to do when something goes wrong. It ends with a short roadmap for the landing page at the root domain and a recap of the course.
What to Test, and With Which Tool
You have already written most of the checks. The point now is to run them together, every time, and to fail the build when one fails:
| Question | Check | From |
|---|---|---|
| Does every folder belong to exactly one site? | Coverage checker for the site map | Chapter 2 |
| Are the pages well formed? | Course validator (banners, filenames, chapter numbers) | Chapter 3 |
| Are accents readable? | Contrast check on the tokens | Chapter 4 |
| Is each menu complete? | Menu gap check against the real folders | Chapter 5 |
| Do solution links and assets exist? | Solution audit; asset copy | Chapter 6 |
| Are sitemaps, canonicals and robots right? | Sitemap and tag generators; redirect test | Chapter 7 |
| Is the deploy safe? Is anything secret in the build? | Deploy and rollback test; secrets scan | Chapter 8 |
| Did every page survive the move? | Parity check, expected against built | Chapter 10 |
| Do all redirects land correctly? | Redirect map test; curl -I on the server | Chapter 11 |
| Does every link in the finished site work? | Built-site link check | This chapter |
Put them in one script, in this order, cheapest first, and stop on the first failure. Run it before every deploy. The checks that depend on a server (certificates, Apache's handling of non-ASCII addresses) cannot be simulated, so they live on the launch checklist below.
The Built-Site Link Check
Every other check looks at the source or at a plan. This one follows every internal link in the finished output and confirms it reaches a file. Run on the current site, it followed about 289,000 links in 5,014 pages and found 205 distinct broken targets on 521 pages. The top of the list:
| Target | Pages | What it is |
|---|---|---|
/japan/hiragana/hiragana-tiles | 141 | The dead back-link found in Chapter 10 (since fixed) |
/japan/katakana/katakana-tiles | 141 | Its katakana twin (since fixed) |
.../javascript/fundamentals/solutions/js1-1_challenge*.txt | 2 each | Missing solution files (Chapter 6 found 54) |
/about, /predictor/, /mark-used/<id>/ | 2 to 6 | Example addresses inside lessons, not real links |
/anime/, on almost every page. That
folder is a PHP application with index.php, not index.html, and the checker only
accepted the second. When one target is “broken” everywhere, the checker is more likely to be
wrong than the site. Fix the checker, then read what is left. The remaining 205 targets were not all triaged;
only the top of the list was.
HTML Checks and Visual Checks
A link checker will not tell you that a page is malformed or looks wrong. Two inexpensive additions are worth having, and neither was run for this course:
- An HTML validator over a sample of each page type (a chapter, a cheat sheet, a kanji page). The W3C Nu validator is the usual tool. Fragments need wrapping in a page first, since they have no
<html>element of their own. - A visual sample. Open one page of each type on each site, in a narrow window as well as a wide one, in dark and print preview. Pay special attention to a language page with its accent colour, a code block with its copy button, and a table on a phone width.
The Budget: Size, Time and Cost
Exercise 2 measured the current build by the site each file would belong to:
| Site | Files | MB | PDF share |
|---|---|---|---|
| programming | 5,182 | 264 | 78% |
| languages | 1,149 | 210 | 93% |
| systems | 2,160 | 118 | 75% |
| webdevelopment | 1,720 | 95 | 76% |
| humanities | 1,686 | 57 | 63% |
| Others (ai, lifeskills, creative) | 1,901 | 77 | 71% to 80% |
| Shared / not in a site | 590 | 123 | 73% |
| Total | 14,388 | 945 | 79% |
PDFs are 79% of the bytes. The HTML is small. That changes the deployment design from Chapter
8: copying the whole build into every release wastes disk on PDFs that did not change. Exercise 2 tests an
rsync option, --link-dest, which hard-links unchanged files to the previous release.
Three releases of a 40 MB build dropped from 115 MB to 39 MB.
--link-dest test looked correct by disk size, but the live page still showed version 1
after three deploys. rsync treats a file as unchanged when its size and modified time match, and the two
versions had the same size and were written within the same second. On a real build the opposite happens:
every file gets a new modified time, so nothing is ever linked. Adding --checksum compares
contents and fixes both. Test the live content after changing a deploy, not just the disk usage.
Build time is its own budget. A full build of the current site (npm run build) was
timed after the course was written: 4,996 pages in about 1 minute 35 seconds in total. Write
the number down, and treat a large jump as a reason to look, not a number to accept.
The Launch Checklist
For each site, in order. Nothing here is optional:
- DNS record resolves; virtual host enabled;
apache2ctl configtestpasses (Chapter 8). - HTTPS works for every name with no warning; renewal rehearsed with
certbot renew --dry-run. - Pre-deploy gate passes: coverage, validation, menus, solutions, secrets scan, parity.
- Built-site link check shows no new broken target.
robots.txtand sitemap are right for the stage: crawling blocked while testing, allowed at launch.- Canonical links use the final address; the old site is not yet redirecting.
- Redirects rehearsed as 302 on the server with
curl -I, including non-ASCII and trailing-slash cases, then switched to 301. - Old site's menu changed to link to the new site.
- Sitemap submitted; Search Console watched for the first weeks.
- Rollback rehearsed once, and a restore from backup tested.
Operating the Sites
The server log is the best monitor you have, and it costs nothing. Exercise 3 summarises it (on a synthetic sample, since no real log was available): status classes, the most requested missing pages, and the number of redirects served. A routine that stays small enough to actually do:
| When | What |
|---|---|
| Daily (automatic) | Disk space (PDF-heavy releases fill disks); certificate renewal dry run |
| Weekly | Top missing pages from each access log; the Apache error logs; the built-site link check |
| Monthly | External link check (305 external links today); Search Console coverage and crawl errors |
| Quarterly | A real restore from backup; review of who has access to what |
When It Goes Wrong
- A bad release: run the rollback script. The previous release is still on disk, and the switch is one rename.
- A bad redirect rule: switch it back to 302 or remove it; the old site is still there until the area is retired.
- A certificate problem: check the renewal timer and
certbot renew --dry-runfirst; a name missing from the certificate is the usual cause after adding a site. - A leaked credential: change it first, then clean the content, then redeploy (Chapter 8). Do not rely on deleting the text.
- A search drop after a move: check redirects return a single 301 to the exact new page, sitemaps are submitted, and the canonical links agree. Wait several weeks before drawing conclusions.
Roadmap for the Root Domain
Once areas have moved, osztromok.com becomes a portfolio and landing page. It is the simplest
site of all, and it can be built last and with the same pipeline:
- Decide the address first: bare domain,
www, or both with one redirecting to the other (Chapter 5). Everything else depends on it. - Content: a short introduction, a card for each site generated from the site map (so it can never list a site that does not exist), and contact details.
- Keep the old site alive for the areas not yet moved, on its own virtual host or a path, until the last area is retired.
- Order the remaining areas by how clean a cut each is: run the link inventory from Chapter 10 on each, start with the cleanest, and fix its existing bugs before moving it.
- Retire the old site last, keeping the redirects for at least a year.
Hands-On Exercises
Write a checker that follows every internal link in a built site and reports the broken targets, counting each once as a distinct target and once per page affected. Run it on the current build, triage the top entries, and explain how you would tell a checker bug from a site bug.
๐ View solutionMeasure the build by the site each file would belong to and the share that is PDFs. Then test an rsync --link-dest deploy against a plain copy on a 40 MB file over three releases, and make sure the live page shows the newest version.
Write a summariser for Apache's combined log format that counts requests by status class and lists the most requested missing pages and the number of redirects. Test it on a small sample you invent, and write the monitoring routine you will actually follow.
๐ View solution๐ Course Complete
You have finished Learning Website: Framework & Architecture. In twelve chapters you went from asking whether the site should be split to a plan you can follow, with scripts, measurements and a rollback at each step. Here is the whole journey.
| Chapter | Topic | You can now… |
|---|---|---|
| 1 | Why Split the Site | weigh a subdomain split against a path split, and decide area by area |
| 2 | Mapping Content to Sites | assign every folder to exactly one site and check it by script |
| 3 | The Content Model | read a page's metadata from its file and handle every banner shape |
| 4 | The Shared Design System | share a design with tokens and migrate old pages safely |
| 5 | Navigation Across Sites | build a global bar, site menus and cross-site links that cannot drift |
| 6 | The Content Pipeline | follow a file through the build and audit solution links and assets |
| 7 | Search, Sitemaps & SEO | generate sitemaps, canonicals and robots files per site |
| 8 | Hosting & Deployment | host several sites, deploy atomically, roll back and keep secrets out |
| 9 | Accounts, Progress & Shared Services | decide whether to add accounts and design them safely if so |
| 10 | Migrating One Area at a Time | move one area with a way back at every phase |
| 11 | Rewriting Links & Redirects | audit every link and generate and test the redirect map |
| 12 | Testing, Launch & Operations | gate a release, launch with a checklist and run the sites afterwards |
Chapter 12 Quick Reference
- Run all the checks together before every deploy, cheapest first, and stop on the first failure
- The built-site link check found 205 distinct broken targets on 521 pages (about 289,000 links followed)
- When one target is broken on almost every page, suspect the checker first
- PDFs are 79% of the build (745 of 945 MB); use
rsync --link-destwith--checksumfor cheaper releases - Measure build time yourself; the number to watch is the trend
- Launch checklist: DNS, vhost and
configtest, certificate and renewal dry run, gate, link check, crawl rules, redirects as 302 then 301, old menu link, sitemap, rollback and restore rehearsed - Monitor: disk and certificate daily; 404s and error logs weekly; external links and Search Console monthly; a restore test quarterly
- Rollback: switch the release link; turn a redirect back to 302; the old site stays until an area is retired
- Root domain last: a landing page generated from the site map, with the address (bare or
www) decided first