Software and Other Mysteries

On code and productivity with a dash of unicorn dust.

The Rabbit Hole of Hosting

I recently published my first blog post in almost four years. It turned out to be a less than straight forward journey, so I thought I’d share the adventures I experienced while venturing into the rabbit hole.

  1. Search for credentials to the server where the only copy of my blog existed. Found them well hidden in an old 1Password vault.

  2. Clone the Git repo of my blog from that server.

  3. Write a blog post. This did not take as long as the rest of these steps.

  4. Find out how to use Octopress 2. To be clear, that is an older version of a static site generator that seems to have been unmaintained for quite a few years now.

  5. Remember my weird af deployment method. How to deploy, you wonder? From my laptop I commit the newly generated site, push to a remote repository on the server, SSH into the folder from which nginx serves the files (which is on the same server) and git pull. Genius.

  6. By this point, the post was actually published, but I realized that the blog wasn’t served via HTTPS, which just feels unacceptable in the day and age of Let’s Encrypt.

  7. As I was going to setup Let’s Encrypt, I also realized that the server was running Ubuntu 14.04.5, which was released mid-2016.

    I’m not sure if I should give myself credit for telling my wife somewhere around this step that I would regret doing this.

  8. Before upgrading I checked if there were any backups of the droplet on Digital Ocean. The answer was no. I enabled backups, but the first backup would not run until next morning, so they would not cover me right now.

  9. Instead I shut down the instance and took a snapshot which I could recover from later, if necessary.

  10. Upgrade server from Ubuntu 14 to 16 and then straight on to 18. What could go wrong?

  11. Something went wrong. The upgrade broke an old site running on CodeIgniter 2 and PHP 5, which I had no intention of spending much – or preferably any – time maintaining. The problem was that only PHP 7 was installed now, which didn’t play well with the site.

  12. I found an alternative package repository from which I could install PHP 5.6.

  13. The version of CodeIgniter the site was using had an issue with PHP 5.6, so I monkey-patched the framework core files to fix the error. ¯\_(ツ)_\/¯

  14. No errors anymore, but the site was only displaying a blank page. After some searching it turned out to be a missing PHP 5 mysql package.

  15. I was finally ready to set up Let’s Encrypt, which was already running for the site I had just broken. I upgraded LE and made sure everything was still working for both the new setup and the old.

  16. Profit?

This is the kind of moment that reminds me of what working in tech is all about: perseverance and Google.

In unrelated news, I’m taking suggestions on which static site generator to use moving forward.

Comments