Saturday, February 09, 2008
Installing Apache2::Cookie (and friends) on Ubuntu Server
Eureka! It worketh! Hopefully. After a few hours of dismal struggle, I finally got libapreq2 with its Perl libraries to install on Ubuntu Server. I need them for Apache2::Cookie, so the default apt-get install of libapreq2 didn't do it for me (don't even get me started on Ubuntu's spaghetti packaging). Anyhow, I still can't get the thing to install via cpan, and looking at all the failures in its test reports I'm not surprised. But I did get it to build from source, and pass all its tests, and install, though I haven't checked yet that it actually works (I'm naively trusting the unit tests). Here's how I got it working. 1) Get the source and unpack it, since cpan (and -MCPAN) probably won't be able to install it for you. 2) Double-check the Perl modules listed in the PREREQUISITES file. The dependencies aren't handled gracefully, so you'll want to install those before trying anything else. 3) Make sure you have the following dev packages installed, in addition to the normal packages that got your server up and running. This isn't covered in the instructions, and you'll get somewhat cryptic error messages if you don't do this stuff first. sudo apt-get install apache2-threaded-dev sudo apt-get install libapache2-mod-perl2-dev 4) Configure the Perl way (./configure failed for me) thus (the option is MANDATORY): perl Makefile.PL --with-apache2-apxs=/usr/bin/apxs2 5) Build away, from here out it was smooth sailing with just some mysterious (but presumably valid) skips. make make test # if all tests passed, then: sudo make install While I was slogging through this I was collecting some info that might be useful to the developer, and I was going to file a bug. But now that I'm through it, it seems like the bug is pretty vague ("sloppy build, possibly not cpan-compatible") unless I spend a few more hours investigating, and I don't have the hours. There are already several open build bugs and a pretty scary failure report on the testing service, so I'm hopeful that when/if this code gets out of purgatory my problems will go away too. Now it's off to the races, and hoping that the code itself is as solid as the build was shaky.