#!/bin/bash #CONFARGS = --target=apache --with-layout=Debian \ # --enable-suexec --suexec-caller=www-data \ # --suexec-docroot=/var/www \ # --suexec-logfile=/var/log/apache/suexec.log \ # --without-confadjust --without-execstrip \ # --enable-shared=max --enable-rule=SHARED_CHAIN \ # --enable-module=most --enable-module=status \ # --enable-module=log_referer --enable-module=log_agent \ # --enable-module=auth_db \ # --activate-module=src/modules/extra/mod_macro.c # # Use this command (before installing) to keep the local suexec across updates: # dpkg-divert --local --rename --divert /usr/lib/apache/suexec.debian --add /usr/lib/apache/suexec # HTTPD_USER="www-data" LOG_EXEC="/var/log/apache/suexec.log" DOC_ROOT="/home" set -e S=/usr/local/share/apache B=`pwd`/suexec-build mkdir $B #for f in suexec.c suexec.h ap_config.h; do # zcat $S/$f.gz > $B/$f #done zcat $S/suexec.c.gz > $B/suexec.c #cp suexec.c $B/suexec.c zcat $S/ap_config.h.gz > $B/ap_config.h zcat $S/suexec.h.gz > $B/suexec.h.orig cat $B/suexec.h.orig | sed \ -e 's!^\(#define HTTPD_USER\).*$!\1 "www-data"!' \ -e 's!^\(#define LOG_EXEC\).*$!\1 "/var/log/apache/suexec.log"!' \ -e 's!^\(#define DOC_ROOT\).*$!\1 "/home"!' \ > $B/suexec.h gcc -lm -lcrypt -ldb1 -ldb -ldl -I/usr/include/apache-1.3 -o $B/suexec $B/suexec.c