diff options
-rw-r--r-- | network/mod_chroot/README | 21 | ||||
-rw-r--r-- | network/mod_chroot/mod_chroot.SlackBuild | 69 | ||||
-rw-r--r-- | network/mod_chroot/mod_chroot.info | 8 | ||||
-rw-r--r-- | network/mod_chroot/slack-desc | 19 |
4 files changed, 117 insertions, 0 deletions
diff --git a/network/mod_chroot/README b/network/mod_chroot/README new file mode 100644 index 0000000000000..391c8e08050b7 --- /dev/null +++ b/network/mod_chroot/README @@ -0,0 +1,21 @@ +mod_chroot allows you to run Apache in a chroot jail with no additional files. +This makes running Apache in a chroot environment easy. + +The chroot() system call is performed at the end of startup procedure - when +all libraries are loaded and log files open. No need for a special directory +hierarchy (containing /dev, /lib, /etc...), unless an external handler, such +as suEXEC or suPHP, is being used, or system()-like functions are in use. + +This package pre-creates /var/chroot/httpd with just enough subdirs to enable +the stock Slackware config to run. Provided /etc/httpd/httpd.conf contains: + +ChrootDir /var/chroot/httpd +LoadModule chroot_module lib/httpd/modules/mod_chroot.so + +And the following (or similar) commands where run: + +mount -o nosuid,nodev --bind /var/run/httpd /var/chroot/httpd/var/run/httpd +mount -o nosuid,nodev --bind /srv /var/chroot/httpd/srv +mount --bind /var/www /var/chroot/httpd/var/www + +Above commands maybe added to rc.local. diff --git a/network/mod_chroot/mod_chroot.SlackBuild b/network/mod_chroot/mod_chroot.SlackBuild new file mode 100644 index 0000000000000..5ef4c197c72a7 --- /dev/null +++ b/network/mod_chroot/mod_chroot.SlackBuild @@ -0,0 +1,69 @@ +#!/bin/sh + +# Slackware build script for mod_chroot +# Written by Menno E. Duursma <druiloor@zonnet.nl> + +# This program is free software. It comes without any warranty. +# Granted WTFPL, Version 2, as published by Sam Hocevar. See +# http://sam.zoy.org/wtfpl/COPYING for more details. + +PRGNAM=mod_chroot +VERSION=${VERSION:-0.5} +ARCH=${ARCH:-i486} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp + +if [ "$ARCH" = "i486" ]; then + SLKCFLAGS="-O2 -march=i486 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +fi + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Create destdir +mkdir -p $PKG/usr/lib/httpd/modules + +# Build +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +apxs -ca mod_chroot.c + +# Copy into place, and strip +install --mode=755 --strip .libs/mod_chroot.so $PKG/usr/lib/httpd/modules + +# Create initial environment +mkdir -p $PKG/var/chroot/httpd/{srv,var/run/httpd,var/www} + +# Documentiation +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a [A-Z][A-Z]* $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $CWD/README > $PKG/usr/doc/$PRGNAM-$VERSION/README$TAG + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +# Make the package; be sure to leave it in $OUTPUT +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz diff --git a/network/mod_chroot/mod_chroot.info b/network/mod_chroot/mod_chroot.info new file mode 100644 index 0000000000000..13bb20cb56b79 --- /dev/null +++ b/network/mod_chroot/mod_chroot.info @@ -0,0 +1,8 @@ +PRGNAM="mod_chroot" +VERSION="0.5" +HOMEPAGE="http://core.segfault.pl/~hobbit/mod_chroot/" +DOWNLOAD="http://core.segfault.pl/~hobbit/mod_chroot/dist/mod_chroot-0.5.tar.gz" +MD5SUM="d72716052faa3bdd3371210f26b13f38" +MAINTAINER="Menno E. Duursma" +EMAIL="druiloor@zonnet.nl" +APPROVED="David Somero"
\ No newline at end of file diff --git a/network/mod_chroot/slack-desc b/network/mod_chroot/slack-desc new file mode 100644 index 0000000000000..051562e5d9592 --- /dev/null +++ b/network/mod_chroot/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. Line +# up the first '|' above the ':' following the base package name, and the '|' +# on the right side marks the last column you can put a character in. You must +# make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':'. + + |-----handy-ruler-----------------------------------------------------| +mod_chroot: mod_chroot (an Apache module) +mod_chroot: +mod_chroot: This module runs the Apache webserver in a chroot environment. +mod_chroot: Making it easy to control what httpd 'sees' of the filesystem. +mod_chroot: +mod_chroot: mod_chroot was written and is maintaind by Hobbit of segfault.pl +mod_chroot: +mod_chroot: +mod_chroot: +mod_chroot: +mod_chroot: |