Jekyll25 Sep 2016
If you’re reading this then, phew, your browser has stopped caching the old index.html and you’re no longer being redirected to /blog/… It’s been a slightly eventful couple of days on the server front.
I’m still not entirely sure what’s been happening, but a couple of weeks ago most of the LAMP stack was flagged for an update, so I pulled it all down, tested the blogs and everything seemed fine. What I didn’t notice was that certain php pages in Wordpress were causing PHP to segfault. This left some browsers complaining that the site was no longer secure (because the connection was dropped prior to receipt of content) or just showing a blank page. And, in some cases, everything would just take twice as long to load.
I noticed this on the way to my teaching class on Friday and dug into it a little more during Friday afternoon / this morning. It’s not much fun trying to get Apache to dump core, and/or try and catch errors with GDB attached. In fact, the latter is nearly impossible, the debugger’s presence was normally enough to prevent the segfault. But after four or five hours of faffing about, I got as far as PHP causing a crash in libc, but the exact lines of code have still eluded me. Rolling back the LAMP stack and moving to an older version of Wordpress didn’t make any difference, so somewhere along the line I’ve picked up a version of something that’s just causing problems. Moving to PHP7 changed changed the issue, but only so much as moving the crash to a different location.
Basically, that was all a massive fucking waste of time, as I’m none the wiser.
So, I’ve binned Wordpress. I’ve never really been much of a fan, and the idea of requiring a load of PHP code to generate what are basically static webpages - this is a blog, after all - seems idiotic. So behold, and welcome to the new Jekyll powered blog.
I should really have done this in the beginning, and I did look at it, but my cursory glance at Jekyll kinda put me off as I didn’t fancy having to write my own templates and layout snippets to build the blog up from scratch. Today’s, slightly more in-depth look at it, made me realise that I can just clone a theme and be done with it. So hurrah!
There’re several immediate plus sides to this:
- I can edit posts in emacs or vim.
- I can store the blog in my Git repro.
- It’s therefore easier to back up.
- One bash script does the jekyll build, adds files to git, pushes to origin and rsync’s to the server.
I’ve also binned the company blog, and moved that over to Jekyll as well.
The migration from Wordpress is surprisingly easy. I couldn’t use any of the plugins, as that’s one of the few that are crashing atm, but I was able to use wpxml2jekyll, a handy windows exe that’ll do most of the legwork from a WPXML file.
The moral of the story: don’t put off doing the right thing, you’ll just end up fucking up your weekend at some point in the future.