Excuse me while I geek out a minute. A large chunk of my holiday was spent in geek mode. Yes, I partook of holiday spirits, exercised a bit, and relaxed — but I needed to do some pretty significant updates to some outdated servers that I’m responsible for on campus. One, I choose to run, and the other houses three pretty important sites. Here’s what I did.
A couple of years after I got to MSC, the Humanities Division got an Apple Xserve. We had several tasks for it: application sharing, file sharing, project storage, and a web server. It would support our Mac classroom, M-124. I remember getting that sweet piece of equipment; I liked it so much, I even kept it in my office for a while so I could pretend like I could feel the power of those dual G5 processors. I think this was 2004.
Well, since then, a lot has changed. There’s no longer a Humanities Division, but a Department of Media, Culture & the Arts and an English Department. I stayed with the former. I have been tenured, we have a new president, and we just got a new room full of iMacs — among other things. One thing that hasn’t changed: that Xserve is still around; however, it’s now obsolete. The last upgrade I was able to do to it was Leopard, and it will not run anything more recent from Apple. I began to run into problems with PHP and MySQL requirements on Moodle — Apple was no longer updating those in Leopard. Yes, I could have reverted to some command-line juju, but one of the reasons you get a server from Apple is that it has a purty GUI for all that admin stuff. Well, I learned my lesson.
When it comes to servers, there’s only one OS for me: Linux. And there’s only one flavor I eat: Debian. Oh, I’ve tried others, and some are pretty tasty, but like a good slice of cheese pizza, there’s just something that calls you back to the simplicity — the minimalism of that perfect recipe. Plus, Debian is one of the only ones left that supports the now very obsolete PowerPC architecture. Man, when Apple decides to obsolete something, they do not mess around.
By this time, I’m a pretty experienced system administrator. If I don’t know how to do something, those better then I have already solved the problem and posted somewhere on the Interwebs. I really love the open-source community. When it came time to transfer, I was already prepared. My daily archives were ready on a backup disk, so I didn’t really need to do much else before the transfer. Since the Xserve has three drives, I just took the one out that had my Leopard Server install on it, and replaced it with a blank.
Debian installed with no problems whatever. Period. The server was up and running within twenty minutes with sshd ready for my work from home that night.
With my soft pants on and a Makers Mark on the desk, I set up the server that evening.
The first thing I needed to do was set up my LAMP server. The L(inux) part was done; that just left the AMP. I had done this many times, but this install would be different. Instead of one web site, I was running four, so I needed a configuration that could do this. I found this tutorial by Sam Kleinman. I didn’t need the scripting, so I skipped that section. WordPress needs the rewrite module, so that was the only extra module I activated. I got my idea for filesystem organization from this article by Steve Kemp.
The best part of this new process was Sam’s last advice on installing a multi-processing module. Basically, this lets users run their own Apache instances. This is a life-saver for upgrading both WordPress and Moodle, since the Web server is essentially running under the user account’s permissions.
Next, I just populated the accounts with the data from the most recent backups.
There’s not much to say here, really. I installed the latest version of WordPress, added my database file, and uploaded my themes and plugins folders. The hardest part of installing WP is getting the permalinks working, but since I added the rewrite module to Apache and configured the preferences file already, they just worked.
Moodle presented a bit more of a challenge because we had been running an old version. So not only were we moving servers, I had a significant update to the new version of Moodle. I initially installed a fresh version of Moodle using their new "git" install. Where has this been all my life? Git not only makes installs easier, but makes periodic updates significantly easier. Bravo!
Triggering the install from a web browser, I made sure I had all the modules installed that I needed for the new version. I did have to install a few, but Aptitude made this easy — another reason I like Debian. Once I was sure the server was ready for Moodle, I added my old preferences that pointed to the database file. It took some time, but I was able to upgrade to the new version (2.2) in about thirty minutes.
There are still some difficulties with the new version of Moodle, but these are just upgrading woes — they have nothing to do with the server. After installing, I did notice that Moodle wanted me to migrate my database from MyISAM to InnoBD. I followed the instructions in a tutorial that I can’t find now. It wasn’t a bad process, albeit a bit anxiety-inducing. It took a while because my database was big. After all, we have been using Moodle for at least six years.
Finally, I set up cron to trigger all my Moodle business every half-hour.
The rest was setting up a backup plan with an extra drive and cron. I even shared some ssh keys with my other server to do some remote daily backups. You can never bee too careful.
Finally, I discovered the php-apc performance tuner. It really made a difference on my server. For some reason, Xcache was already installed, but wasn’t helping. I ditched that and installed php-apc for a pretty significant difference. Follow Francois Planque’s tutorial for some more info and a way to measure your performance.
In all, a partial holiday well spent. Now, to get to that essay I need to write…