Sometimes it pays to Cowboy Code.
“Im going to regret this moment” I said out loud as I ignored my own advice about having a server-level backup before I started messing around with my server settings.
When I am working on client sites, I am beyond careful to never code on the live site, and to have multiple redundant backups, so that no matter how routine a task is, if it breaks something, I can roll back the changes and all is well.
When I’m working on my own sites, however, I often ride a little faster and looser with the code. It’s my little way of living dangerously.
That brings us back to Saturday night. I was at my kids’ basketball skills practice, and decided to go ahead and “finish” the “quick” job of adding Let’s Encrypt to my server (the one that hosts this site). So, I fiddled with the settings, and went to reboot nginx, and got a fun “connection refused” on my site. No worries, just roll back that last change, and restart nginx again, right?
Nope. I had borked my Nginx settings somehow beyond simple repair.
Does it count as cowboy coding if you're looking for an excuse to start over from scratch? Click To TweetFull disclosure: I’ve been looking for an excuse to move all of my sites into one DigitalOcean droplet, and this seemed like as good a time as any to get the process started. Besides, figuring out what I had broken on my site would probably take just as long as starting over from scratch, given the amount of learning I’ve done since I first set up that server. So I didn’t try all that hard to fix whatever I broke, since I new I had a full WordPress backup waiting for me.
If there’s a silver lining to my ~25 minutes of downtime on Saturday night, it’s that I was able to spin up an entire new virtual server, install Apache, Nginx, MySQL, PHP, and WordPress (restored from a backup the night before) in just those 25 minutes. (Allow me to pause and give ServerPilot and DigitalOcean the credit, here.) I set the DNS changes in motion before I’d finished setting up the new server, to minimize down time.
The great news is that just two days later on that same new server, I’ve now got my 2 WordPress installs and my URL shortener (powered by YOURLS) all humming along nicely. That’s gonna save me about $20 per month over what I was spending for 3 separate droplets before.
Sometimes it does pay to cowboy code, I guess.
My next trick will be to install Let’s Encrypt (a little more cautiously) on this new server. Perhaps I should take a backup first…
Nah. I’ll just wing it.