Your First Website: From Server to Search · 9/10

Website Operations for Beginners: Logs, Monitoring, Backup and Restore

Create a small operating routine for a first website: health checks, disk and memory monitoring, versioned backups, off-server copies and a tested restore procedure.

0 reads

A live page is the start of operations

The first quiet week is when operating habits are easiest to build. Do not wait for an outage to discover where logs live or whether a backup exists. For a small static site, a five-minute daily check and a weekly backup review are enough to create a much safer baseline.

Keep a private runbook containing the server provider, public IP, domain registrar, DNS provider, SSH user, web root, Caddyfile path, deployment command, backup location and recovery contact. Store secrets separately from the runbook.

The five-minute health check

bash
systemctl is-active caddy
curl -fsS -o /dev/null -w '%{http_code} %{time_total}s\n' https://example.com/
df -h / /var
free -h
uptime

Expect active, an HTTP 200 for the canonical home page, comfortable disk headroom and no unexplained memory pressure. A server with cache in use is not automatically short of memory; focus on available memory, swap activity, restarts and trends.

Check the public URL from outside the server too. A local curl can succeed while DNS or a cloud firewall is broken for readers.

Read logs with a question

Do not read every log line as an emergency. Begin with a time window and a question: Did Caddy restart? Was the certificate renewed? Did the request reach this host?

bash
systemctl status caddy --no-pager
journalctl -u caddy --since '1 hour ago' --no-pager
journalctl -p warning --since today --no-pager

Save the exact timestamp, URL and symptom when investigating. Do not paste access tokens, cookies, IP lists or full private logs into a public issue.

Make a versioned website backup

A backup on the same server is a useful first copy, not a complete backup. Create a protected directory, archive the web root and configuration, calculate checksums, then transfer the archive to another account or storage system you control.

bash
sudo install -d -m 0700 /var/backups/my-first-site
sudo tar -czf /var/backups/my-first-site/site-$(date +%F-%H%M).tar.gz -C /var/www/my-first-site .
sudo cp /etc/caddy/Caddyfile /var/backups/my-first-site/Caddyfile-$(date +%F-%H%M)
sudo sha256sum /var/backups/my-first-site/*

If the application later gains a database or uploads, file copying alone is no longer enough. Add database-consistent exports and application data according to that software's official backup procedure.

Test a restore without touching production

Choose one archive explicitly and inspect it before extracting. Use a temporary test directory, not /var/www/my-first-site, for the first exercise.

bash
mkdir -p /tmp/my-first-site-restore-test
tar -tzf /var/backups/my-first-site/site-YYYY-MM-DD-HHMM.tar.gz | head
tar -xzf /var/backups/my-first-site/site-YYYY-MM-DD-HHMM.tar.gz -C /tmp/my-first-site-restore-test
find /tmp/my-first-site-restore-test -maxdepth 2 -type f -print

Replace the archive placeholder with a real filename. Open the restored index and compare checksums or preview it on 127.0.0.1. A backup becomes trustworthy only after you prove that you can locate, decrypt, extract and understand it.

Alerts and maintenance rhythm

At minimum, alert on a failed HTTPS request, low disk space and repeated service restarts. A simple external uptime checker covers the reader's path better than a server-only script. Review patches weekly, back up before an upgrade, validate the site after it, and record what changed.

Define retention before automating deletion: for example, daily copies for a week and monthly copies for several months. Test the selection output before allowing any cleanup command to remove archives.

What I learned

For a long time I said the site was backed up because a tar file existed on the same disk. That file would have disappeared with the server. The useful change was not a more complicated tool; it was an off-server copy and a calendar entry to restore one archive into a temporary directory every month.

Finish line

You are ready to grow traffic when you can detect an outage, find recent logs, name the latest off-server backup and restore it to a test directory. The final article turns the working site into something Baidu and Google can discover and understand.