Self hosted blogs are not for the faint of heart
In December I wrote about hosting a WordPress blog on Digital Ocean and said:
Blogging is an excuse to write more. Writing is a great way to think clearly about a subject. Running a website on a (small) Linux droplet is a starting point to learn more about the ops side of the world.
Shortly after publishing this I got to deal with the less fun side of the ops journey. I use Cloudflare as a CDN and caching layer over Kenst.com. It looks roughly like this:
DNS is configured through Cloudflare rather than my hosting provider. Occasionally there have been issues where Cloudflare can’t talk to the droplet (virtual machine) and the site becomes inaccessible.
Right after the December post went live, that same problem came up and took the down the site. Eventually I think Cloudflare sent an email alerting me, but I found out quicker via someone on Twitter.
Most of the time things hum along quite nicely and my ops work is minimal. However when things do go wrong, they can be time consuming to debug and fix. In the past while updating Linux packages (as a DIY ops person you patch your own security holes) I managed to install wrong versions of PHP and then somehow couldn’t get apache running again. That wasn’t fun.
Now I take regular snapshots (in addition to backups) to make it faster to restore when I mess up. DigitalOcean offers API access which I’ve setup in Postman for easy access when something isn’t working.
Back to my original problems, I managed to solve both by:
- Installing the Cloudflare WordPress plugin. I can’t say why this had a positive impact but I haven’t had the issue since.
- Set up an uptime service to monitor site’s availability (which right now is great).
Working in technology is a forcing function to understand conceptually how systems work together (like CDNs, DNS, and virtual machines). Applying them to my own projects turns that conceptual understanding into hard fought knowledge of how systems can work and fail. All it takes is a lot of time, patience and an ability to deal with failure! Self hosted blogs are not for the faint of heart!