Building limitipconn is fairly straight forward. It utilizes a simple Makefile build for the DSO object (which just uses apxs).

First, make sure you have all of the required libraries:

# apt-get install apache2-prefork-dev libapr1-dev

Here’s the simple diff from the default Makefile, to my modified one to ensure building. You can cut and paste this into vi, nano, or your favorite text editor, then apply to the Makefile included within the limitipconn package using patch:

—- Makefile.old        2007-04-27 17:50:57.000000000 +0200
+++ Makefile 2007-04-27 17:53:24.000000000 +0200
-4,12 +4,12 ##

# the used tools -APXS=apxs -APACHECTL=apachectl +APXS=/usr/bin/apxs2 +APACHECTL=/usr/bin/apache2ctl # additional user defines, includes and libraries #DEF=-Dmy_define=my_value -#INC=-Imy/include/dir +INC=-I/usr/include/apache2 -I/usr/include/apr-1.0 #LIB=-Lmy/lib/dir -lmylib # the default target

All I did was update the Makefile to work with Debian’s installation for the utilities (differently ordered by the Apache major revision), and added the include directories, because the module’s author used indirect paths.

# cd /where/i/unpacked/limitipconn
# vi Makefile.patch (paste in my above patch, save and quit.)
# patch -p0 < Makefile.patch

Now, just make the module (This is almost cheating, but easier for folks not entirely familiar with the libtool build process):

#make install

Technically, it’s now installed. You can restart Apache and it will load. This isn’t 100% Debian friendly, as it uses /etc/apache2/httpd.conf, rather than the /etc/apache2/mods-*/*.{load|conf }heirarchy, but making it so is beyond the scope of this simple article.

I can, however, be coerced into doing so for money. ;)

If you haven’t noticed, yet, many of my recent developments have been for, and regarding Debian.

A current client is a RedHat Enterprise 4, CentOS, FreeBSD, and Debian shop, with Debian being on the front end. As the key systems are integrated to a unified OS approach, one of the most important aspects is to keep your front end systems up to date with security, first and foremost, then consistant features (with the legacy, where appropriate), and finally, new bells and whistles.

This ensures your deliverability; I can’t understand how large companies like YouTube manage to redirect people to a page saying ‘Sorry, guys, it’s that time of the week again. Everything’s down for a few hours.’

That’s awful design, and incredibly useless if your whole product is reliant on actually being available to make money.

Yet, I digress. This is now “Web 2.0” where the game seems to be “content over form.” All hail the new Emperor.. just as soon as he finishes touching up his body paint.

I’m all for commerce, and advertising is just a side effect of consumerism. However, I don’t want to see ads when I’m checking my bank account online. I consider this pretty crass, and sad that my bank would opt to allow such things.

Below is the information I’ve discovered to make it go away:

If you do not want to receive prescreened offers of credit from this or other companies, call the consumer reporting agencies toll free, 888-567-8688; or write: TransUnion Name Removal Option, P.O. Box 505, Woodlyn, PA 19094; Equifax Information Service Center, P.O. Box 740123, Atlanta, GA 30374-0123; or Experian Direct Marketing, P.O. Box 919, Allen, TX 75013.

Thankfully, BofA made this fairly easy to find today (after three years of no opt out information). Perhaps they were sued.

This is incredibly simple, but it’s amazing how many people (ab)use Perl to do something that awk was designed for.

Here’s how to find your existing Linux styled ethernet interfaces:

%ifconfig -a | awk '(/inet\ addr/||/^eth/||/^lo/)&&!/127/ \
gsub(/inet\ addr:/, "") { print $1}'
eth0
10.10.0.212
eth1
85.92.154.212
eth1:1
192.168.30.1
lo
127.0.0.1

Those of you who might be able to read that will ask: Why not /127/? It’s a dummy test. :)

Long story short, due to political (licensing) reasons, MySQL support was removed from Apache’s APR base. Here’s how to get it back and fix a few bugs in the default driver (the default causes it to die with various named virtualhosts):

First, ensure you have the ability to build all of the requirements:

# apt-get build-dep libaprutil1 libaprutil1-dev

Then, install the libmysqlclient support (the new MySQL 5 driver):
# apt-get install libmysqlclient15-dev wget apache2.2-common

Get the necessary driver
# apt-get source apr-util
# cd ./apr-util-1.2.7+dfsg/dbd
# wget 'http://apache.webthing.com/svn/apache/apr/apr_dbd_mysql.c'
# cd ..

Get the timeout patch.
  1. wget ‘http://issues.apache.org/bugzilla/attachment.cgi?id=20479’ -o apr.patch
  2. patch < apr.patch

Build libaprutil1.
# vi debian/rules
.. add —with-mysql=/usr to the configure line ..
# (fakeroot) debian/rules binary

Install APR (add dev if required.)
# dpkg -i ../libaprutil1_1.2.7+dfsg-2_i386.deb \
   ../libaprutil1-dev_1.2.7+dfsg-2_i386.deb

Get the Apache source
# apt-get source apache2
# cd apache2-2.2.3/modules/database/

Update the database driver
# wget 'http://svn.apache.org/viewvc/httpd/httpd/trunk/modules\
/database/mod_dbd.c?view=co'
# mv 'mod_dbd.c?view=co' mod_dbd.c

Build the new Apache:
# cd ../..
# (fakeroot) debian/rules binary

Install the new Apache (I need PHP, so I use prefork):
# dpkg -i ../apache2-mpm-prefork_2.2.3-4_i386.deb \
   ../apache2-utils_2.2.3-4_i386.deb

Now, go ahead and enable it, then restart:

#ln -s /etc/apache2/mods-available/dbd.load /etc/apache2/mods-enabled/
#/etc/init.d/apache2 restart

You may wish to tag your custom Apache to keep it from being overwritten by standard apt upgrades:

#for n in libapr1 libapr1-dev libaprutil1 \
libaprutil1-dev apache2-mpm-prefork \
apache2-utils apache2.2-common; do echo $n hold | \
dpkg --set-selections; done

You’re all set!

[Edit: When I wrote this initially, I was thinking of an older way to flag packages with apt; the proper way is to set them with dpkg. Thanks to Bart Cilfone for noticing my err.]

[Edit 2: A clarification by Stephan Jansen appended for your information (steps above modified): The mod_dbd.so is located in the apache2.2-common package, so this needs to be install also.
Another issue: There is a bug in apr-util which causes authentication to fail after an mysql-connection timeout occures (default: 8 hours of inactivity). The Patch at bug #42841 resolved this problem for me.]