It’s been rough!
Up until recently, wiiulinux.net
has been a collection of manually written HTML & CSS files, good old Web 1.0 style.
What the site used to look like. CC0.
However, a few weeks ago (at time of writing), I decided it would be a good idea to get with the times and migrate to WordPress, so it would be easier to update the site, add new information, and actually allow this site live up to its tagline. The Home of Linux on the Wii U. A few days ago, I finally committed to actually making it happen.
Problem number 1: I didn’t have MariaDB or PHP installed. But that’s an easy enough problem to fix; just install them, right? No. That’s because I’m running Gentoo. Unlike, say, Debian or Arch, which distribute ready to use binary packages, on Gentoo every package is compiled locally. In my case, that means compiling them on the Wii U’s 1.24 GHz G3-derived CPU. Making matters worse, Linux on the Wii U [at time of writing] is limited to using one core! Needless to say, compiling MariaDB and PHP on a single core 1.24 GHz G3 takes a while.
Problem number 2: NGINX. Because the Wii U is so comically under-powered, I settled on NGINX as my web server, because it has a reputation of being faster than Apache. The problem here is that running WordPress on NGINX is harder than doing so on Apache, though it is possible. One of the things you’ll need to make this work is to build of PHP with FPM support. However, Gentoo does not build PHP with FPM by default, and I had no idea I needed to change that because I didn’t read any “Setting up WordPress using NGINX” tutorials until after I installed PHP! So I had to tell Gentoo “Please enable FPM support,” and wait another 2 hours for PHP to build again.
By this point, a day and a half in, I was only just now ready to install WordPress. Well, almost ready. I first had to set up MariaDB and tweak my NGINX config, but that was all pretty straightforward. So, I downloaded WordPress, unzipped it into my new NGINX web root, and was just about to start setting it up when suddenly, I remembered, in the access log, I had seen people trying to access /wp-admin/setup-config.php?step=1
and I realized “Hey, maybe I oughta take the server off the internet while doing this.” After avoiding my Wii U becoming compromised, I proceeded to finish the WordPress setup uneventfully. And within 3 minutes of installing WordPress, I had broken it so badly I could no longer log in. Here’s what happened.
Problem number 3: SSL. I noticed all the links on the site pointed to the local IP address of the Wii U, which is a problem for a public website, so I poked around in the WordPress settings, and changed the page URL to https://www.wiiulinux.net
. Upon doing so, I became unable to log in.
So, a bit of context: wiiulinux.net
does not handle requests from the internet directly, but instead runs behind a reverse proxy. Because of this, I had never bothered to set up SSL on the Wii U side, as the reverse proxy handled it. This meant requests the Wii U always received HTTP requests. But I just told WordPress to expect HTTPS. What was happening was, WordPress saw my HTTP request, and redirected me to https://www.wiiulinux.net
. The reverse proxy forwarded my request as HTTP, resulting in an endless loop that prevented me from logging in. However, even once my Dad figured out what was going on, it took us another hour to actually get SSL working on NGINX and get the problem solved. Unfortunately, this was not the end of our problems.
Problem number 4: NGINX again. Now that I had WordPress working again, I wanted to get to work making the site look nice. However, the page editor refused to load. I discovered upon closer inspection that this was caused by the server failing to find a bunch of important files! So, my Dad and I and set spent the next 3 hours trying to figure out why this was happening and what how to fix it. He was methodically thinking through the problem, I just threw ideas at the wall to see if that would fix it. Eventually, my Dad figured out that all we had to do was slightly rewrite 1 rule in the NGINX config.
#try_files $uri $uri/ /index.php?$args =404;
location / {
try_files $uri $uri/ /index.php?$args;
}
Yep. That’s it. After making that change, the editor worked perfectly. By this point, it was near midnight, so I decided to go to bed and work on designing the site tomorrow. But WordPress had one last, headache inducing surprise in store for me.
Problem number 6: Designing a page with WordPress. For the header, I wanted to have 2 inwards facing Tux penguins, like I did before. That requires flipping one of the images, but I couldn’t just add transform: scaleX(-1);
to the CSS one of the images because, as far as I can tell, there is no way to add custom CSS to a specific instance of a block in WordPress. You can only add it to every occurrence of that block on the whole site. Luckily, my Dad saved the day once again when he had the idea to just make a flipped version of Tux and have two separate, independent image blocks. Although this is not the last time WordPress’s design has caused me pain, for the sake of brevity I’ll spare you the details. Suffice to say, it’s been frustrating.
For all it’s many, many faults though, I do still believe the migration to WordPress is a positive step for wiiulinux.net
. WordPress can provide a really nice experience, if you’re using it as intended; ie: for writing blog posts. Writing this post using WordPress has been way easier than it would have been had I written it manually. Thank you so much to my Dad, who was absolutely essential in helping me through this transition. Thank you for all your hard work and your kind, patient support while helping me. Here’s to a more active future for wiiulinux.net
. Maybe it’ll finally live up to it’s hyperbolic tagline.
Leave a Reply