Host configuration

Switching to a new web host is always fun. I spent most of Monday and Tuesday trying to get the Subversion client and Apache module installed and working. Today I tinkered with Sendmail enough to get it doing what I want.

Installing Subversion was much more tricky than it seemed at first. My host has libapr 0.9.4 installed, but Subversion requires at least 0.9.7 since earlier versions can corrupt fsfs repositories (which is the type I prefer). I tried 1.3.3 and ran into some interesting problems.

The core issue was that 0.9.4 was in /usr/lib, and the dynamic linker was grabbing that one for Apache before 1.3.3 was loaded for the Subversion module. Since 0.9.4 was loaded first, and 0.9.4 and 1.3.3 share symbols, some of the functions the Subversion module calls were being incorrectly linked to the 0.9.4 version, which presumably is not ABI-compatible since the major version number differs. This resulted in segmentation faults on every request to the server, effectively taking down my website. In order for this to work I would have to get the dynamic linker to take 1.3.3 first, but then Apache would have the same issue — using an ABI-incompatible version of a library it was linked against.

So I got 0.9.17 and installed that, then ran into another dilemma. 0.9.4 is in /usr/lib, so it gets priority. The dynamic linker was still loading 0.9.4 first and loading 0.9.17 when Apache loaded the Subversion module. This means that the module, while linked against 0.9.17, would effectively use 0.9.4. So corruption of fsfs repositories would still be a possibility.

This is where a bit of the weirdness begins. My host gives me write permissions on just about every directory, including /usr/bin and /usr/sbin. But for some reason, not /usr/lib. So I couldn’t just divert the libapr-0.so symlink over to 0.9.17. I was stuck here for a while, mulling the issue over.

A few hours later I returned to the problem with an idea: /etc/ld.so.config. This is where the list of library directories are stored, and the first ones listed get searched first. /usr/local/lib was at the top, followed by /usr/lib. Since I installed libapr in an alternate prefix (/usr/local/apr), I had two options: symlink to 0.9.17 from /usr/local/lib, or add /usr/local/apr/lib to /etc/ld.so.config. Yes — /etc/ld.so.config was writable, and /usr/lib was not. Go figure.

I decided to add my libapr path instead of symlinking. And now all is well in the Apache world.

That describes the last two days. Today I had the unpleasant task of trying to convince sendmail that mail for chrishowie.com should not be delivered to local mailboxes on the web server, since I don’t use my host’s mail service. After poking around with sendmail.cf for an hour or two and not making any headway I joined #sendmail on Freenode and requested help. Between all the comments about how my server’s hostname should be www.chrishowie.com and not chrishowie.com (something that’s out of my power to change) I got some pointers that lead to a new, minimal, and working sendmail configuration:

OSTYPE(`linux')dnl
DOMAIN(`generic')dnl
FEATURE(`stickyhost')dnl
FEATURE(`nullclient',`chrishowie.com')dnl
undefine(`ALIAS_FILE')dnl

Ta-da. Now all email sent from the server goes through my domain’s real mail servers.

That’s the last thing I had to do to get my hosting where it should be. At this point I consider migration to the new host complete. Now I can return to coding that C# networking stack…