mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-21 19:42:24 +01:00
network/mod_hosts_access: Initial import
This commit is contained in:
parent
4c82c26e60
commit
ba122a081a
4 changed files with 117 additions and 0 deletions
27
network/mod_hosts_access/README
Normal file
27
network/mod_hosts_access/README
Normal file
|
@ -0,0 +1,27 @@
|
|||
mod_hosts_access
|
||||
|
||||
This is a DSO (dynamically shared object) module for the Apache webserver
|
||||
that uses libwrap (TCP Wrapper) to check if the connecting hosts is allowed.
|
||||
|
||||
To enable it, add to /etc/apache/httpd.conf following lines:
|
||||
|
||||
LoadModule hosts_access_module libexec/apache/mod_hosts_access.so
|
||||
AddModule mod_hosts_access.c
|
||||
|
||||
At appropriate places (i.e. where other modules are loaded similarly).
|
||||
|
||||
The /etc/hosts.{allow,deny} access control checking for the "httpd" service
|
||||
can now be enabled or disabled on a per directory basis, by adding HostsAccess
|
||||
directive to its declaration, e.g.:
|
||||
|
||||
# First, we configure the "default" to be a very restrictive set of
|
||||
# permissions.
|
||||
#
|
||||
<Directory />
|
||||
HostsAccess On
|
||||
Options FollowSymLinks
|
||||
AllowOverride None
|
||||
</Directory>
|
||||
|
||||
The same can be done in a .htaccess file if AllowOverride Limit has been set.
|
||||
|
71
network/mod_hosts_access/mod_hosts_access.SlackBuild
Normal file
71
network/mod_hosts_access/mod_hosts_access.SlackBuild
Normal file
|
@ -0,0 +1,71 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Slackware build script for mod_hosts_access (libwrap support in Apache)
|
||||
# Written by Menno E. Duursma
|
||||
|
||||
PRGNAM=mod_hosts_access
|
||||
VERSION=1.1.0
|
||||
ARCH=${ARCH:-i486}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
CWD=`pwd`
|
||||
TMP=${TMP:-/tmp/SBo}
|
||||
PKG=$TMP/package-$PRGNAM
|
||||
OUTPUT=${OUTPUT:-/tmp}
|
||||
|
||||
if [ "$ARCH" = "i486" ]; then
|
||||
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
||||
elif [ "$ARCH" = "i686" ]; then
|
||||
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
||||
fi
|
||||
|
||||
rm -rf $PKG
|
||||
mkdir -p $TMP $PKG $OUTPUT
|
||||
cd $TMP
|
||||
rm -rf $PRGNAM-$VERSION
|
||||
tar -xzvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1
|
||||
cd $PRGNAM-$VERSION
|
||||
chown -R root:root .
|
||||
chmod -R a-s,u+w,go+r-w .
|
||||
|
||||
if [ ! -z CFLAGS ]; then
|
||||
CFLAGS_OLD="${CFLAGS}"
|
||||
CFLAGS="$SLKCFLAGS"
|
||||
else
|
||||
CFLAGS_WASSET=no
|
||||
export CFLAGS
|
||||
fi
|
||||
|
||||
# Compile module as DSO (dynmically shared object)
|
||||
apxs -ca mod_hosts_access.c -lwrap -lnsl
|
||||
|
||||
# Restore compiler flags
|
||||
if [ -z CFLAGS_WASSET ]; then
|
||||
unset CFLAGS
|
||||
else
|
||||
CFLAGS="${CFLAGS_OLD}"
|
||||
fi
|
||||
|
||||
# Strip binary
|
||||
strip mod_hosts_access.so
|
||||
|
||||
# Create target dir, copy module into place
|
||||
mkdir -p $PKG/usr/libexec/apache
|
||||
cp mod_hosts_access.so $PKG/usr/libexec/apache
|
||||
|
||||
# Copy program documentation into the package, including this script
|
||||
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cp -a [A-Z]* $PKG/usr/doc/$PRGNAM-$VERSION
|
||||
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
||||
|
||||
mkdir -p $PKG/install
|
||||
cat $CWD/slack-desc > $PKG/install/slack-desc
|
||||
|
||||
cd $PKG
|
||||
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
|
||||
|
||||
# Clean up the extra stuff
|
||||
if [ "$1" = "--cleanup" ]; then
|
||||
rm -rf $TMP/$PRGNAM-$VERSION
|
||||
rm -rf $PKG
|
||||
fi
|
8
network/mod_hosts_access/mod_hosts_access.info
Normal file
8
network/mod_hosts_access/mod_hosts_access.info
Normal file
|
@ -0,0 +1,8 @@
|
|||
PRGNAM="mod_hosts_access"
|
||||
VERSION="1.1.0"
|
||||
HOMEPAGE="http://www.klomp.org/mod_hosts_access/"
|
||||
DOWNLOAD="http://dl.sourceforge.net/httpd-garage/mod_hosts_access-1.1.0.tar.gz"
|
||||
MD5SUM="2e4fd22e778c8d98d433344a46421eb7"
|
||||
MAINTAINER="Menno E. Duursma"
|
||||
EMAIL="druiloor@zonnet.nl"
|
||||
APPROVED="robw810"
|
11
network/mod_hosts_access/slack-desc
Normal file
11
network/mod_hosts_access/slack-desc
Normal file
|
@ -0,0 +1,11 @@
|
|||
mod_hosts_access: mod_hosts_access (Apache hosts ACL module)
|
||||
mod_hosts_access:
|
||||
mod_hosts_access: Httpd support for Wietse Venema's TCP Wrapper (libwrap)
|
||||
mod_hosts_access: hosts based access control system
|
||||
mod_hosts_access:
|
||||
mod_hosts_access: mod_hosts_access is developed by
|
||||
mod_hosts_access: Vincent Partington, Ken Coar
|
||||
mod_hosts_access:
|
||||
mod_hosts_access: Please see the README for instructions no how to enable it.
|
||||
mod_hosts_access:
|
||||
mod_hosts_access:
|
Loading…
Reference in a new issue