Ive been intending on upgrading my Debian firewall/blog box to the latest version, called ‘sarge’ (a.k.a 3.1) for some months now. Today was the day I decided to finally bite the bullet. Since I’ve been using backports of unstable versions of software, such as MySQL (see Upgrading MySQL on Debian for that process, and Enabling Thumbnails for the process to upgrade libgd) I figured this could be a little trickier than I really like, and I should be prepared. Here’s the historical record of actually getting it running. YMMV, of course!
First, the documentation on the Debian web site is good. The upgrading instructions are written per hardware platform and seem complete. I started, as recommended in Upgrading your Woody system by replacing the word “stable” in the /etc/apt/sources.list
file with the word “woody” and then checking I had woody’s version of aptitude installed.
After copying the recommended files to a safe location (that’s a lot of files!), I deleted the /etc/preferences
file after saving a copy — this is the file that says which versions of any software to use. Since to begin with I want to use a clean, standard Debian sarge distribution, I don’t need this file. Then it was on to section 4.2.2, “Checking packages status”. I found that apt-get showed no holds, but aptitude showed that php4 was on hold (I can’t imagine why). So I got rid of the hold.
After that, I just followed the steps, taking the defaults mostly (since I didn’t understand some of the questions, that was an easy choice! One day I might understand what pango and defoma are all about, but in the meantime I’ve decided not to bother). There were a couple of messages that mostly seemed ignorable (note to self: upgrade exim3 to exim4 at some stage in the future) and all in all the process ran smoothly, if not particularly fast on my old, slow Pentium box.
Time to check the results — try my web site and find it’s been replaced by a generic “welcome to an Apache web site” message. The web server has been magically upgraded to Apache 2.0, which I hadn’t quite expected or planned for. Oh well, time to hit the Apache documentation.
There’s a big difference between Debian upgrade documentation and Apache upgrade documentation. Where the Debian upgrade instructions are exactly that (“Do this, then this. Run this command and if you get this output, do this, otherwise do that”), the Apache documentation on Upgrading to 2.0 from 1.3 is basically a list of feature changes, rather than instructions on how to upgrade or what modifications need to be made to the configuration files. Looking at the configuration files themselves in the Debian Sarge Apache 2 distribution you can see, for example, that httpd.conf has changed markedly from being the main configuration file to containing simply a comment saying it exists for backwards compatibility only. The README file does have some clues to the new files, with short descriptions of what they’re used for. The most interesting new directory to me was sites-enabled, which seemed to have something to do with setting up virtual hosts. So I typed sites-enabled into the Apache documentation search engine and found no hits whatsoever. The VirtualHost part of the documentation for Apache 2.0 says “Below is a list of documentation pages which explain all details of virtual host support in Apache version 1.3 and later.” Hmmm, things do seem to have changed somewhat between Apache 1.3 and Apache 2.0. On the other hand, it’s always possible that this particular configuration and choice of directory names etc is due to Debian rather than Apache; the Debian distributions do have a reputation for putting files in places that are unexpected and maybe this has extended to the names used in the Debian flavour of the Apache installations. If this is the case it’s not surprising it isn’t documented on the Apache web site.
Fortunately others have written this up; I found Upgrading to Apache 2 which described the purpose of the sites-enabled and sites-available directories in ways that make sense and worked when I tried them out. The same principles apply to making the mod_rewrite module available, which WordPress uses for rewriting the URLs for archives and categories.
So far, so good. My web site is available again, just not my blog. The error message is “Your PHP installation appears to be missing the MySQL which is required for WordPress”. When I check, all the necessary packages are installed. A quick search through the WordPress support site turns up that I’ve forgotten to uncomment the MySQL module in the php.ini file. I’m so used to Debian just doing the right thing that it seems odd to have to make that change, somehow. Now my blog is back as well, everything else seems to be working, no files seem to have been lost, and overall the upgrade was a lot less painful than I had anticipated.