Posts

Hardening Self Hosted Linux CMS Nodes

Image
Command-line diagnostics running on a minimalist Linux desktop (Photo via Unsplash) Most Linux server security guides read like they were written by someone who has never shipped a Friday afternoon hotfix. They hand you forty sysctl knobs, disable half the PHP standard library, and suggest setting every directory to 0400 . Twenty minutes later, your CI runner breaks, Composer throws permission errors, and editors can't upload a 300KB hero image. Real system hardening for a self-hosted CMS box has to survive routine deployments and messy editorial workflows. If you already moved off managed hosting following our notes on self-hosting web stacks on bare metal , the next step is shrinking the blast radius without breaking atomic releases. On WordPress, Drupal, Craft, or Statamic nodes, breaches rarely start with a kernel zero-day. They start with an unpatched plugin, a weak SSH password, or a writable webroot. Here is the baseline I run on Debian 12 and Ubuntu 24.04 CMS nodes. E...

Automated Offsite Backups and Drills

Image
Git repository commit graph and deployment pipeline view (Photo via Unsplash) A few years back, a client called me at 6:40 AM because a botched plugin update had dropped three tables from their production CMS database. No problem, their team said—they'd run a nightly mysqldump cron job since 2021, and /var/backups held months of neatly dated .sql.gz files. I SSHed in and checked the latest archive. It was 20 bytes long. Every archive from the past four months was 20 bytes long. A routine MySQL password rotation had broken authentication in the script, cron had mailed stderr to a local root mailbox nobody read, and gzip had compressed an empty error stream into a valid 20-byte header every night at 02:00. That failure mode is painfully common. When you're self-hosting web stacks on bare metal without a managed cloud control plane watching your disks, an untested nightly dump script is basically a placebo. Real disaster recovery isn't measured by how many archives s...

Edge Caching Without Stale CMS Edits

Image
Real-time server throughput metrics during peak traffic (Photo via Unsplash) Every publishing team hits the same ugly afternoon eventually. An editor spots a wrong dollar figure in a headline, fixes the typo, clicks Publish, and opens the article in a private window. Nothing changes. Five minutes later Slack lights up. Someone appends ?refresh=1 to the URL, which fixes their laptop and helps nobody else. Twenty minutes after that, the corrected headline finally appears, well after the social traffic has already peaked. This isn't a deep mystery of distributed caching. It happens when someone puts a content delivery network in front of a dynamic CMS, sets a flat twenty-minute TTL on HTML to shield the origin, and treats invalidation as an afterthought. Dropping the TTL to 30 seconds doesn't solve it either; you just hammer the origin every half-minute and still look sluggish to editors. Watching your cache hit ratio sink from 98% to 60% puts immediate read pressure on the d...

Database Indexing for Slow CMS Views

Image
Traffic latency histograms rendered on an operations dashboard (Photo via Unsplash) A few months ago, a regional trade directory I maintain started throwing sporadic 504 Gateway Time-out errors during a Tuesday newsletter blast. Nothing in the basic server graphs looked alarming. The box is a rented 8-core AMD EPYC server running Debian 12, Nginx, PHP 8.2-FPM, and MariaDB 10.11, the same single-node layout I covered when writing about self-hosting web stacks on bare metal . Load average sat around 1.7. Free RAM topped 18 GB. Disk wait stayed under 3 percent. Yet the site felt completely wedged. The homepage and individual listings still responded in 35 milliseconds. We'd already sorted out full-page caching back when I documented edge caching without stale CMS edits . What broke the site was the filtered catalog archive, URLs like /equipment/?region=midwest&status=verified&sort=updated . Faceted query strings bypass page caching by design because thousands of filter com...

HTTP3 and QUIC Tuning on Origin Boxes

Image
Hardware diagnostic workstation in an infrastructure lab (Photo via Unsplash) Turning on HTTP/3 on a self-hosted origin looks deceptively easy in modern web servers. Drop a listen 443 quic line into Nginx 1.26, reload, run curl --http3-only from your desk, and move on. That's what I did on our first Debian 12 origin last autumn, right before noticing desktop fiber numbers barely moved while half our mobile visitors fell back to HTTP/2 after stalling on dropped UDP packets. On clean gigabit fiber with 15ms latency and zero loss, HTTP/3 rarely impresses. Sometimes it's two or three milliseconds slower than tuned TCP and TLS 1.3 because user-space framing and per-datagram crypto burn more CPU than kernel TCP with hardware offload. The real win appears on congested LTE towers, commuter rail links, and transoceanic hops. Running the QUIC transport protocol over UDP while folding Transport Layer Security 1.3 straight into the handshake cuts a round trip off cold connections an...

Blue Green CMS Deployments Done Right

Image
Backend developer profiling SQL query execution plans (Photo via Unsplash) Draw a blue-green deployment on a whiteboard and it looks almost too easy. Spin up an identical green stack next to live blue, run a smoke test, flip the load balancer, and drain blue. For a stateless Go binary serving JSON over HTTP, it really is that boring. You can push forty builds a day without breaking a sweat. Try that playbook on a self-hosted CMS and you'll break production before lunch. At 2:14 PM on a Tuesday, while your deploy job swaps releases, marketing is uploading an 18MB press-kit PDF, a copywriter is saving a draft across four serialized metadata tables, and a worker is halfway through generating WebP thumbnails. Treat a publishing platform like a stateless API and you'll strand uploads in a dead release folder, crash old workers against dropped columns, or serve HTTP 500s from mismatched PHP classes. Making continuous deployment work on a CMS follows one rule: code is immutable...

PostgreSQL vs MariaDB for Modern CMS

Image
Laptop running local container benchmarks at an engineering desk (Photo via Unsplash) Last October, we rebuilt the database tier for a regional news portal holding 310,000 published stories, 1.9 million revisions, and 140 GB of relational and JSON block data. On a normal Tuesday morning, sixty editors sit in the admin UI with auto-save firing every thirty seconds while public traffic pushes 18,000 origin cache misses an hour. Before committing to a five-year support window, I replayed a captured production trace against PostgreSQL 16.4 and MariaDB 10.11.9 LTS on matched bare-metal boxes: 8 EPYC cores, 32 GB ECC RAM, dual NVMe drives in RAID 1, and Debian 12. Most database shootouts run Sysbench loops that look nothing like a publishing portal. You can shave milliseconds off first-byte delivery through HTTP/3 and QUIC tuning on origin boxes , yet one unindexed metadata filter or an autovacuum storm during breaking news will still flatten your origin box. Primary key reads are a tie...