The launch checklist and the maintenance plan

The domain

The name is the part of the site that cannot be rebuilt from a backup. Check it first, and check it once a quarter rather than once.

The details are in lesson 1.

Hosting and site

Lessons 3 and 4 build this list on shared hosting; lesson 5 does the same on your own server.

The server

This is the checklist of lesson 8, compressed. Run it again after every major change, not only at launch.

Mail

The commands and the record values are in lesson 9. A site can go live without mail; a business cannot.

The maintenance schedule

A server does not need attention every day, but it needs a rhythm. This one fits a small site and takes about ten minutes a day, half an hour a week, and an hour a month.

WhenWhat to do
Every dayRead the backup result. Glance at the uptime check and the disk graph. Read the error log if a check was red.
Every weekInstall pending updates. Check free disk and memory. Read the authentication log for new users or strange addresses. Confirm the newest backup opens.
Every monthUpdate the CMS, themes and plugins. Restore one backup into a test folder. Check certificate expiry and renewal. Review the list of accounts with access to the site, the panel and the registrar. Read the access log for a surprising path.
Every quarterReview the firewall rules and the listening ports. Remove unused sites, databases and mailboxes. Change the passwords that are shared. Check the WHOIS record and the transfer lock.
Once a yearPlan a rebuild on a fresh system image. Read the release notes of the distribution. Review the budget of the plan against the traffic.

The commands are ordinary ones from this course: cron runs the backup, sudo apt upgrade patches the system, df -h checks the disk, and journalctl reads the services. The habit matters more than the tool: a calendar reminder that nobody ignores is the cheapest monitoring there is.

When the site is down

Work from the outside in, and stop at the first layer that answers wrongly. Most answers come from three tools: dig for the name, curl for the page and df for the disk. The order is the same every time, which is why it is worth memorising.

1. Is it the site or the visitor? Ask someone else, or use a different network, before you change anything. A local DNS cache or a provider outage looks exactly like a broken server from one chair.

2. Does the name resolve?

dig +short example.com

No answer, or the wrong address, means DNS: the record changed, the domain expired, or the name servers are down. Compare with a public resolver and read the delegation with dig +trace.

3. Does the port answer?

nc -vz example.com 443

Connection to example.com 443 port [tcp/https] succeeded!

A timeout means the firewall, the provider network or a stopped web server. Test from the server itself: if localhost answers and the internet does not, the problem is the path.

4. Does the site answer over HTTP?

curl -I https://example.com

HTTP/2 502 server: nginx

A 502 means Nginx is alive and PHP-FPM is not, or the socket path is wrong. A 500 means PHP ran and the application failed; read its error log. A 403 is a permission or an index problem. A 404 with the right server is a site configuration problem. The codes themselves are in HTTP status codes.

5. Is the disk full? A full disk breaks the database, the logs and the sessions at once, and the error messages point everywhere except at the disk.

df -h /

df -i /

Filesystem Size Used Avail Use% Mounted on /dev/vda1 39G 38G 0G 100% /

A hundred percent used, or a hundred percent of inodes, is the answer. Delete old logs and old backups, then find what grew: du -h /var/log/* | sort -h | tail. Do not delete the database files to make space; move a backup off the server instead.

6. Is the database running?

systemctl status mariadb --no-pager

sudo journalctl -u mariadb -n 20 --no-pager

A database that stops after a disk-full event usually starts again once space is free. A database that stops for another reason has a message in the journal that names the table or the file.

7. What changed? The last deploy, the last plugin update, the last certificate renewal, the last firewall rule. In practice the answer is almost always in the last hour, and the fastest fix is to undo it before you understand it. Then read the logs and understand it.

8. When nothing works, restore. A site that cannot be fixed in half an hour is a site that goes back from the last good backup, while you investigate on a copy. That is why the backup has a restore test in the schedule: at the worst moment, you do not want to learn the restore procedure.

Write down what you found, even when the answer was simple. The next outage will be different, and your notes will be the fastest way to the second line of the diagnosis.

Quiz

1 Which part of a website cannot be rebuilt from a server backup?

  1. The site files
  2. The database
  3. The domain name
  4. The TLS certificate
Answer

c) Files, databases and certificates can be recreated. A name that expired and was registered by someone else is gone, which is why auto-renew, the lock and two-factor authentication matter.

2 What does a transfer lock on a domain prevent?

  1. The site from loading
  2. A move to another registrar without your action
  3. DNS changes
  4. Certificate renewal
Answer

b) clientTransferProhibited blocks a transfer. It does not affect DNS, the site or the certificate.

3 Which record type carries the address of the server for example.com?

  1. MX
  2. A, and AAAA for IPv6
  3. TXT
  4. CNAME
Answer

b) A holds IPv4, AAAA IPv6. A CNAME at the apex is not allowed, and MX and TXT serve other purposes.

4 curl -I https://example.com answers 502. What is the first thing to check?

  1. The domain expiry date
  2. That PHP-FPM is running and the socket in the server block is correct
  3. The MX records
  4. The favicon
Answer

b) A 502 is a bad gateway: Nginx could not reach the PHP handler. Check the service and the fastcgi_pass path.

5 The disk is 100 percent full. Which files are safe to remove first?

  1. The database files
  2. Old rotated logs and old backups on the same server
  3. Nginx configuration files
  4. The site uploads folder
Answer

b) Rotated logs and local backups are copies. Database files, configuration and uploads are live data and must not be deleted to make room.

6 How often should a restore of a backup be tested?

  1. Never, the backup tool is reliable
  2. At least once a month, into a separate place
  3. Only when the site is down
  4. Once, when the site is launched
Answer

b) A monthly restore catches a broken backup before it is needed. Restoring only during an outage turns a bad day into a disaster.

7 Which three settings stop SSH password guessing?

  1. A long root password, a changed port and a banner
  2. Keys only, no root login, fail2ban
  3. Two firewall rules and a new hostname
  4. DNSSEC, HSTS and a certificate
Answer

b) Keys remove the password to guess, no root login removes the account everyone tries, and fail2ban removes the address that keeps trying.

8 A message from your domain passes SPF but fails DKIM and DMARC. What is the most likely cause?

  1. The MX record is wrong
  2. The DKIM selector or the published public key does not match the key that signs
  3. Port 25 is closed
  4. The PTR record is missing
Answer

b) SPF checks the envelope sender, and its pass was not aligned with the From domain, so DMARC failed as well. DKIM signs the From domain, so the failed signature is the thing to fix: a selector that points at a different key, or a key that was regenerated without updating DNS, produces exactly this result.

9 Which maintenance task belongs to the monthly list, not the daily one?

  1. Reading the backup result
  2. Restoring a backup into a test folder
  3. Checking the uptime graph
  4. Reading the error log
Answer

b) The daily list watches, the monthly list proves. A restore test takes an hour and saves a weekend.

10 A visitor says the site is down, and your own browser shows it fine. What do you do first?

  1. Reinstall the server
  2. Check from another network and ask which error the visitor sees
  3. Restore the last backup
  4. Change the DNS records
Answer

b) The site may be fine and the visitor may have a cached DNS answer, a blocked address or an expired session. Confirm the scope before changing a working system.

Article author: Arthur Isaev