diff options
author | Menno Duursma <druiloor@zonnet.nl> | 2010-05-13 00:37:17 +0200 |
---|---|---|
committer | David Somero <xgizzmo@slackbuilds.org> | 2010-05-13 00:37:17 +0200 |
commit | bb003907682d3c9ea99361a128926d7c15ff8326 (patch) | |
tree | c152a165cfc439b20c7857a6d68a2b299d44bf82 /network | |
parent | 46e038ecd35e767749e11ad8362446cea38758ad (diff) | |
download | slackbuilds-bb003907682d3c9ea99361a128926d7c15ff8326.tar.gz |
network/mod_limitipconn: Updated for version 0.23
Diffstat (limited to 'network')
-rw-r--r-- | network/mod_limitipconn/README | 10 | ||||
-rw-r--r-- | network/mod_limitipconn/doinst.sh | 15 | ||||
-rw-r--r-- | network/mod_limitipconn/mod_limitipconn.SlackBuild | 19 | ||||
-rw-r--r-- | network/mod_limitipconn/mod_limitipconn.conf | 5 | ||||
-rw-r--r-- | network/mod_limitipconn/mod_limitipconn.info | 2 | ||||
-rw-r--r-- | network/mod_limitipconn/slack-desc | 12 |
6 files changed, 44 insertions, 19 deletions
diff --git a/network/mod_limitipconn/README b/network/mod_limitipconn/README index 572ce02f33..88a20d6f95 100644 --- a/network/mod_limitipconn/README +++ b/network/mod_limitipconn/README @@ -2,14 +2,10 @@ mod_limitipconn is an Apache which allows web server administrators to limit the number of simultaneous downloads permitted from a single IP address. -The module can be loaded with the following in /etc/httpd/httpd.conf - -LoadModule limitipconn_module lib/httpd/modules/mod_limitipconn.so -ExtendedStatus On -MaxConnPerIP 5 +You'll need to add the following line to your /etc/httpd/httpd.conf: + Include /etc/httpd/mod_limitipconn.conf To test the 'test.pl' utility from mod_evasive is included in the doc dir. Which when run multiple simultainus sessions of should similate accessive connectivity; e.g. with MaxConnPerIP set to ``1'' - -while true; do (perl ./test.pl &); perl ./test.pl; done + while true; do (perl ./test.pl &); perl ./test.pl; done diff --git a/network/mod_limitipconn/doinst.sh b/network/mod_limitipconn/doinst.sh new file mode 100644 index 0000000000..e95f4d5c3b --- /dev/null +++ b/network/mod_limitipconn/doinst.sh @@ -0,0 +1,15 @@ +config() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + # If there's no config file by that name, mv it over: + if [ ! -r $OLD ]; then + mv $NEW $OLD + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then + # toss the redundant copy + rm $NEW + fi + # Otherwise, we leave the .new copy for the admin to consider... +} + +config etc/mod_limitipconn.conf.new + diff --git a/network/mod_limitipconn/mod_limitipconn.SlackBuild b/network/mod_limitipconn/mod_limitipconn.SlackBuild index cd91e2be00..0a698bffb8 100644 --- a/network/mod_limitipconn/mod_limitipconn.SlackBuild +++ b/network/mod_limitipconn/mod_limitipconn.SlackBuild @@ -16,17 +16,20 @@ ARCH=${ARCH:-i486} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -CWD=`pwd` +CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" fi set -e # exit on most errors @@ -35,17 +38,20 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar jxvf $CWD/$PRGNAM-$VERSION.tar.bz2 +tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2 cd $PRGNAM-$VERSION chown -R root:root . chmod -R a-s,u+w,go+r-w . # Compile module as DSO (dynmically shared object) -CFLAGS="$SLACKFLAGS" \ -apxs -ca mod_limitipconn.c +CFLAGS="$SLACKFLAGS" apxs -ca mod_limitipconn.c # copy into place -install -D -m755 -s .libs/mod_limitipconn.so $PKG/usr/lib/httpd/modules/mod_limitipconn.so +install -D -m755 -s .libs/mod_limitipconn.so $PKG/usr/lib${LIBDIRSUFFIX}/httpd/modules/mod_limitipconn.so + +mkdir -p $PKG/etc/httpd +sed "s%@baselibdir@%lib${LIBDIRSUFFIX}%" $CWD/mod_limitipconn.conf > \ + $PKG/etc/httpd/mod_limitipconn.conf.new mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a ChangeLog INSTALL README LICENSE $PKG/usr/doc/$PRGNAM-$VERSION @@ -54,6 +60,7 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc +cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/network/mod_limitipconn/mod_limitipconn.conf b/network/mod_limitipconn/mod_limitipconn.conf new file mode 100644 index 0000000000..650533dfd9 --- /dev/null +++ b/network/mod_limitipconn/mod_limitipconn.conf @@ -0,0 +1,5 @@ +# Apache config for mod_limitipconn + +LoadModule limitipconn_module @baselibdir@/httpd/modules/mod_limitipconn.so +ExtendedStatus On +MaxConnPerIP 5 diff --git a/network/mod_limitipconn/mod_limitipconn.info b/network/mod_limitipconn/mod_limitipconn.info index 9ec443cece..7ffe8349cd 100644 --- a/network/mod_limitipconn/mod_limitipconn.info +++ b/network/mod_limitipconn/mod_limitipconn.info @@ -3,6 +3,8 @@ VERSION="0.23" HOMEPAGE="http://dominia.org/djao/limitipconn2.html" DOWNLOAD="http://dominia.org/djao/limit/mod_limitipconn-0.23.tar.bz2" MD5SUM="08885977f8e0c50659a54c8e40ddd675" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" MAINTAINER="Menno Duursma" EMAIL="druiloor@zonnet.nl" APPROVED="dsomero" diff --git a/network/mod_limitipconn/slack-desc b/network/mod_limitipconn/slack-desc index 9baa055e08..0c235b0ff1 100644 --- a/network/mod_limitipconn/slack-desc +++ b/network/mod_limitipconn/slack-desc @@ -5,15 +5,15 @@ # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. - |-----handy-ruler------------------------------------------------------| + |-----handy-ruler------------------------------------------------------| mod_limitipconn: mod_limitipconn (an Apache connection limit module) mod_limitipconn: -mod_limitipconn: This module allows web server administrators to limit the -mod_limitipconn: number of simultaneous downloads permitted from a single -mod_limitipconn: IP address. +mod_limitipconn: This module allows web server administrators to limit the number +mod_limitipconn: of simultaneous downloads permitted from a single IP address. +mod_limitipconn: +mod_limitipconn: mod_limitipconn was written by David Jao and Niklas Edmundsson. +mod_limitipconn: mod_limitipconn: -mod_limitipconn: mod_limitipconn was written by David Jao -mod_limitipconn: and Niklas Edmundsson mod_limitipconn: mod_limitipconn: mod_limitipconn: |