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:

QuestionCheckFrom
Does every folder belong to exactly one site?Coverage checker for the site mapChapter 2
Are the pages well formed?Course validator (banners, filenames, chapter numbers)Chapter 3
Are accents readable?Contrast check on the tokensChapter 4
Is each menu complete?Menu gap check against the real foldersChapter 5
Do solution links and assets exist?Solution audit; asset copyChapter 6
Are sitemaps, canonicals and robots right?Sitemap and tag generators; redirect testChapter 7
Is the deploy safe? Is anything secret in the build?Deploy and rollback test; secrets scanChapter 8
Did every page survive the move?Parity check, expected against builtChapter 10
Do all redirects land correctly?Redirect map test; curl -I on the serverChapter 11
Does every link in the finished site work?Built-site link checkThis 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:

TargetPagesWhat it is
/japan/hiragana/hiragana-tiles141The dead back-link found in Chapter 10 (since fixed)
/japan/katakana/katakana-tiles141Its katakana twin (since fixed)
.../javascript/fundamentals/solutions/js1-1_challenge*.txt2 eachMissing solution files (Chapter 6 found 54)
/about, /predictor/, /mark-used/<id>/2 to 6Example addresses inside lessons, not real links
Suspect the checker first
The first version reported 4,994 broken links to /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:

SiteFilesMBPDF share
programming5,18226478%
languages1,14921093%
systems2,16011875%
webdevelopment1,7209576%
humanities1,6865763%
Others (ai, lifeskills, creative)1,9017771% to 80%
Shared / not in a site59012373%
Total14,38894579%

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.

A fix that looked right and served stale pages
My first --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:

  1. DNS record resolves; virtual host enabled; apache2ctl configtest passes (Chapter 8).
  2. HTTPS works for every name with no warning; renewal rehearsed with certbot renew --dry-run.
  3. Pre-deploy gate passes: coverage, validation, menus, solutions, secrets scan, parity.
  4. Built-site link check shows no new broken target.
  5. robots.txt and sitemap are right for the stage: crawling blocked while testing, allowed at launch.
  6. Canonical links use the final address; the old site is not yet redirecting.
  7. Redirects rehearsed as 302 on the server with curl -I, including non-ASCII and trailing-slash cases, then switched to 301.
  8. Old site's menu changed to link to the new site.
  9. Sitemap submitted; Search Console watched for the first weeks.
  10. 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:

WhenWhat
Daily (automatic)Disk space (PDF-heavy releases fill disks); certificate renewal dry run
WeeklyTop missing pages from each access log; the Apache error logs; the built-site link check
MonthlyExternal link check (305 external links today); Search Console coverage and crawl errors
QuarterlyA 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-run first; 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:

  1. Decide the address first: bare domain, www, or both with one redirecting to the other (Chapter 5). Everything else depends on it.
  2. 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.
  3. 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.
  4. 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.
  5. Retire the old site last, keeping the redirects for at least a year.

Hands-On Exercises

Exercise 1

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 solution
Exercise 2

Measure 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.

๐Ÿ“„ View solution
Exercise 3

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.

ChapterTopicYou can now…
1Why Split the Siteweigh a subdomain split against a path split, and decide area by area
2Mapping Content to Sitesassign every folder to exactly one site and check it by script
3The Content Modelread a page's metadata from its file and handle every banner shape
4The Shared Design Systemshare a design with tokens and migrate old pages safely
5Navigation Across Sitesbuild a global bar, site menus and cross-site links that cannot drift
6The Content Pipelinefollow a file through the build and audit solution links and assets
7Search, Sitemaps & SEOgenerate sitemaps, canonicals and robots files per site
8Hosting & Deploymenthost several sites, deploy atomically, roll back and keep secrets out
9Accounts, Progress & Shared Servicesdecide whether to add accounts and design them safely if so
10Migrating One Area at a Timemove one area with a way back at every phase
11Rewriting Links & Redirectsaudit every link and generate and test the redirect map
12Testing, Launch & Operationsgate a release, launch with a checklist and run the sites afterwards
What Next?
This course is the blueprint. Two courses implement it: Learning Website with Django and Learning Website with Next.js. Both start with the languages site, because Chapter 10 showed it is the cleanest first move. Before you start either, fix the three open findings from this course: the exposed database password (Chapter 8), the dead hiragana and katakana tile links (Chapter 10), and the question of the 105 MB Hungarian resources folder.

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-dest with --checksum for 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