Ciao CentOS, Ciao Ubuntu

I actually got pretty excited when they finally announced CentOS 8.

Why?

Because I’m a weird computer guy who likes to try out different operating systems. Hell, I still have an OpenSolaris Live DVD from 2009 and I reseed Haiku torrents. I once even bought an overpriced 15-20 year old Mac desktop tower from a pawn shop just to play around with Mac OS 9.

So, as soon as I could, I spun up a local VM to test things out.

I had only been at Reclaim Hosting for a few months at that point, and had only officially been our SysAdmin for, like, a day when they announced CentOS 8. And my new role meant that I was going to be dealing with CentOS 8 quite a bit, seeing as how it was going to be the next version of the OS we run/ran quite a bit of our infrastructure on.

And then they killed CentOS.

And I had no idea what the hell we were supposed to do. Because if you’re running an enterprise Linux server then you’re gonna with the premier enterprise Linux distro: RHEL.

But if you’re running a ton of enterprise Linux servers and don’t have the budget to get a RHEL licenses for every single one, then you’ll go with the free and community supported distro that’s, like, 99% compatible with RHEL: CentOS.

Well, I guess not anymore…

I mean, rationally, I knew that alternatives/replacements were going to spring up. Eventually. Far too many people were far too reliant on CentOS to just let it die like that. But in the moment it was a little worrying, because:

  1. It wasn’t clear which CentOS derivative was going to be the CentOS replacement.
  2. cPanel at the time was only supporting CentOS/RHEL, and cPanel hosting was (and still is) a large part of what Reclaim Hosting does.

So, yeah, very worrying in the moment.

But then cPanel made a great announcement: they were going to support Ubuntu.

I’ve run Ubuntu on both desktop and servers, and I’ll readily admit that I’ve had my problems with it (there are reasons why I run Manjaro on my desktop and not Ubuntu or one of its derivatives). apt can get weird awful sometimes with dependencies and I absolutely hate snaps. But it’s not all bad with Ubuntu. It’s pretty straightforward to use, and I also like how there are ways to upgrade the server between releases (which is something that can’t be said for CentOS/RHEL, or even Debian, at least if I recall correctly). Oh, and (to my knowledge) they haven’t EOL’d a major release of an OS that is relied on by countless people out of nowhere for no good reason.

So, I was rather content to start working on getting us Ubuntu-ready in preparation for CentOS 7’s EOL.

But the Ubuntu stuff was still going to be a lot of work.

While both Ubuntu and CentOS are Linux, there’s differences in package managers, package names and dependencies, paths to configuration files, and so on. So it wasn’t going to be a matter of just picking up our scripts from a CentOS machine and running them as they are on an Ubuntu machine. I had to test each part of the process, each script, each server vendor, each PHP module, and so on. If all of these tedious and repetitive little things weren’t part of the process to automate something, I may have gone insane, and so on.

For the most part it was simple. Replace yum with apt, replace checks for 7 with checks for 20.04, change the paths of some binaries, AND SO ON.

Maybe the tedium and repetition did drive me to madness, and so on.

It was actually the install processes for cPanel and Bitninja that caused the most headaches during the process.

Bitninja needed a specific dependency before it could be installed on Ubuntu, and a botched install of cPanel did something weird to the repos. So I had to install that package prior to doing anything else.

apt install apt-transport-https --yes

And then the reason why the cPanel install was getting botched was that it didn’t like the installed-by-default MySQL client. So that (and its dependencies) had to be uninstalled rather early as well. It also had trouble installing a few dependencies, so I installed these right after.

apt remove snmp libsnmp35 libmysqlclient21 --yes && \
apt install libnl-genl-3-200 libnl-3-200 --yes

But even after all of that the cPanel install kept stalling up because service restarts (and outdated kernel versions) needed to be acknowledged interactively. So I had to make a conf change to just let those things happen automatically.

sed -i "s/^\#\$nrconf{restart}.*$/\$nrconf{restart} \= \'a\'\;/" /etc/needrestart/needrestart.conf && \
sed -i "s/^\#\$nrconf{kernelhints}.*$/\$nrconf{kernelhints} \= \-1\;/" /etc/needrestart/needrestart.conf

And then after cPanel was finally installed, I realized that the test WordPress instance I setup was totally broken. And after digging through cPanel’s PHP settings I saw that quite a few critical Easy Apache modules were not installed. Turns out that while CentOS has their package names like mod_whatever, Ubuntu has them like mod-whatever. But this was easy enough to fix with more sed.

sed -i "s/mod_/mod\-/g" /path/to/ea4modules.json

So after quite a bit of trial and error, quite a bit of reading the logs, and quite a bit of yelling at my machine, I finally was able to get an Ubuntu server running cPanel and all the other normal stuff! And after a few more tweaks and fixes, I was able to get another one up; and that second one became our first Shared Hosting server running Ubuntu as opposed to CentOS.

Speaking of which, that’s where you’re reading this from now. Yeah, my sites are now being served from a new Ubuntu server rather than a CentOS server. I was my own test subject. Partly because I wanted to hold off on subjecting anyone else to my OS experiments, and partly because FIRST ACCOUNT ON OUR FIRST UBUNTU SHARED HOSTING SERVER. WOO.

So that’s nice.

Ubuntu is definitely going to be our future. At least on the cPanel front.

But we’re not gonna be fully locked in to Ubuntu like we were with CentOS. Just in case, y’know? Because while cPanel is a big part of what Reclaim Hosting does, it isn’t the only thing, and some of the things we run do require something CentOS-ish. And that something CentOS-ish is shaping up to be AlmaLinux.

And maybe (thanks to cPanel) we might even be able use AlmaLinux to extend the lives of our existing servers through in-place upgrades from CentOS 7!

Maybe.

That’s something I still need to look into.

But I’ll talk about that more when we get there.

1 thought on “Ciao CentOS, Ciao Ubuntu”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.