mod_limitipconn and Debian Etch's Apache 2.2.

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. ;)