mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-21 19:42:24 +01:00
network/mod_limitipconn: Updated for version 0.23
This commit is contained in:
parent
46e038ecd3
commit
bb00390768
6 changed files with 44 additions and 19 deletions
|
@ -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
|
||||
|
|
15
network/mod_limitipconn/doinst.sh
Normal file
15
network/mod_limitipconn/doinst.sh
Normal file
|
@ -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
|
||||
|
|
@ -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}
|
||||
|
|
5
network/mod_limitipconn/mod_limitipconn.conf
Normal file
5
network/mod_limitipconn/mod_limitipconn.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Apache config for mod_limitipconn
|
||||
|
||||
LoadModule limitipconn_module @baselibdir@/httpd/modules/mod_limitipconn.so
|
||||
ExtendedStatus On
|
||||
MaxConnPerIP 5
|
|
@ -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"
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue