Building a self hosted website

Where else to begin but here? I created this site to document my journey as I learn new technologies, the first of which was creating a VM in a cloud to self host a website. Now, obviously, I could have paid Squarespace to make this a lot easier, and I know some pretty influential podcasters so I even could have gotten a discount. But the purpose here is to learn. Also, with a little bit of effort, self hosting is completely free (other than the cost of the domain name). Learning is appealing. Free is even more appealing.

Skills developed

  • Launching a free VM on a cloud service (in my case, OCI)
  • Create A virtual cloud network, and modifying a security list
  • Creating a public and private keypair and connecting via SSH
  • Navigating Linux to install software and update config files
  • Generating an SSL. Even goofy little blogs need security
  • Troubleshooting

Lessons Learned

You can find a lot of resources and YouTube videos which will walk you through how to set up a website. Heck, if you’re really interested, I’ll embed the video I followed. Instead, I want to talk about changes I elected to make, and some troubleshooting I had to do as a result. I knew I wanted to create a certificate, and redirect HTTP traffic to the more secure HTTPS protocol. A lot of tutorials will have this broken out; Here’s how to create a website and This is how to create an SSL certificate on your established website. After I installed and set up Linux, the webserver software, a database, and PHP- and updated them all, I paused tutorial 1, and ventured off to tutorial 2 Adding and SSL with Let’s Encrypt. This created a couple issues in my WordPress and PHP config files. Let’s Encrypt created the server entry for me (thanks), but I didn’t realize that, so when I continued with the first tutorial, I was editing the wrong config files. This took some time to figure out, and was frustrating, but it helped me understand what the server blocks were and what they were actually doing in the config file. I’ll remember something a lot longer if I understand why I’m doing it and not just how to do. Frustrating, time consuming troubleshooting often forces you to learn “the why”. Troubleshooting is it’s own reward.

If you’re interested in a step-by-step guide, Tony Teaches Tech has this video tutorial

With all that done, and an SSL installed, I felt considerably more comfortable logging in to the admin portal and update my brand new website. I made a couple quick UI changes. I don’t really want to focus on front end stuff, as I’m sure is evident, but I wanted some polish. Great, job done time to start writing the very first couple sentences of the post you, dear reader, are reading! And “draft not saved. JSON error”. That’s it! Just…. JSON error? No… details? I lied to you earlier. Troubleshooting is not it’s own reward. Troubleshooting is time consuming and awful.

WordPress doesn’t seem to give you a lot of information on errors like this. After a little bit of googling, I was able to narrow it down to, “Anything could be causing that error, but if you know how to read JSON you should be able to figure it out”. Okay, plan B. I undid some of the theme changes I made until I was able to save drafts again. It turned out the “permalinks” option was the culprit, if you’re curious. I could have just left the ugly permalinks (this post would be something like “thedatabunker.com/?p=48” for reference), but now that I know the culprit, it should be easier to find the solution. Another quick, and this time more narrow search, and I just had to update the server block of the config file I became familiar with before.

And with that, I can finally start writing this, my first blogpost.