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.

5 comments:

Anonymous said...

sudo apt-get install libapache2-request-perl

Anonymous said...

Many thanks! This has been a huge headache. I appreciate the effort :)

frosty said...

Dear Anonymous,

Tried that. Didn't work. YMMV.

Anonymous said...

U need to install the Apache-dev package.

the mod_perl2 libs (libapache2-request-perl) need the apxs2

frosty said...

Dear Anonymous 2.0:

Tried that. Didn't work either. YMMV. I love the innernets, it's like a peanut gallery with extra-small peanuts.

Since then I've largely given up on Ubuntu as a serious destination platform, though I would still recommend it to anyone who wants to "play around" with Linux, or who only will ever need one virtual server, or even (in support of their business model) for small offices needing what Microsoft sells but not needing Microsoft compatibility per se.

But to prove I'm not so hard-core, I've simply fallen back to Fedora (v8 until everybody catches up with Perl 5.10). It's a much more mature platform for real-world use. If my personal obsession were sysadmining I'd probably insist on some flavor of BSD, but since it's software development I mostly want things to be sane and to not break. For my needs, Fedora is closer to that mark than Ubuntu is.