Server move from RPi to FreeBSD
Server move from RPi to FreeBSD
For just over a year, this blog has run on a Raspberry Pi 4 running DietPi Debian, sat on my desk. It's done pretty well to be fair - maintenance is easy and it's never crashed or locked up - the only down-time has been due to it being accidentally powered off, and it's rebounded easily after power was restored. Since I got the NAS up and running, though, it's been niggling at me that I ought to host the blog on that and get a tiny bit of desk space, and a power socket back. The Rpi could then be re-utilised for something else.
So, here we are, running on FreeBSD instead of Debian, and using Nginx rather that Lighttpd. I've moved the Nikola site generator to my main laptop too, because it always felt a bit clunky editing blog posts in Vim over SSH. So I'm trying out editing this post in Zettlr, a GUI (shock, horror) app that I've used for years to manage my Markdown-based notes. Let's see how this works out.
The migration process was actually pretty easy, but required a few changes in software stack for ease of use and different environment. I decided to change the web server to Nginx as Let's Encrypt's "certbot" can automatically handle installing certificates in Nginx's configuration file, and somewhat simplifies the certificate update process compared with the more manual approach you have to use with Lighttpd, which was what I'd opted for on the RPi because it's supposed to be more efficient RPi. As the NAS is a fully fledged x86 CPU with an SSD attached, I didn't see the need to battle with the configuration differences between Debian and FreeBSD as well as the manual certbot shenannigans.
I'm glad I did, too, because it took a bit of reasearch to work out where FreeBSD puts everything: I'm a bit rusty with FreeBSD as I hadn't used it for nearly a decade before I set up the NAS last year, and it has a rather different approach to Linux, where non-OS programs like Nginx and Certbot have their files in a separate directory hierarchy - instead of all the config files going in /etc, they go in /usr/local/etc and there are some other oddities to catch you out if you're not careful. I thought I'd got everything straight - copied certs across from the RPi to the NAS box, got the software installed - Nginx and Certbot, and rsynced the static blog files across. Surprisingly, the cert worked first time once I got the broadband router to redirect port 443 to the NAS instead of the Pi, and I was able to page around my blog fine. However, when I went to test Certbot with automatic update of certs, it crashed with an error, which was due to me not realising that the domain config file for makerpunkbuzz.mywire.org actually contained hard-coded paths. It was relatively easy to fix once I worked out what was actually wrong: because things are now in different places, the paths in the config file were now wrong. It was an easy fix, but I feel I'm getting sooo rusty on this stuff. I tell ya, Windows (my current day job) rots your brain.
So, it's all up and running again, and I have a new whizzy wiggy markdown editor I can use to make blog posts - I'm hoping that might make it easier to keep up with blogging. I got loads of projects done last year - mainly laser cutter-related - but I just couldn't find the time and energy to blog about them. Going to try to correct that this year!