Showing posts with label mod_perl. Show all posts
Showing posts with label mod_perl. Show all posts

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.

Installing apxs2 on Ubuntu Server

Ah, another happy Saturday doing sysadmin crap. I had a lot of trouble scaring this information up, so maybe a blog post will help the next person. In order to get apxs2 installed on Ubuntu (and probably Debian) you must install apache2-threaded-dev (or possibly a non-threaded equivalent). You will start to care about that if, for example, you want to install Apache2::Cookie, which depends on APR::Request, which is messy. But oh, wait, that module is broken and won't install anyway. If I figure out how to fix it, I'll probably post again for the same imagined posterity... currently the thing says my perfectly good apache2 binary is bad. Anyway, regardless of that problem, you will also be unable to install APR::Request without an apxs2 binary, and you'll have a hard time finding that on Ubuntu unless you sudo apt-get install apache2-threaded-dev (or equivalent).