summaryrefslogtreecommitdiff
path: root/make-suexec-for-home
blob: 7d291afb2f100e21ef018592f4fac06801e177c4 (plain)
  1. #!/bin/bash
  2. #CONFARGS = --target=apache --with-layout=Debian \
  3. # --enable-suexec --suexec-caller=www-data \
  4. # --suexec-docroot=/var/www \
  5. # --suexec-logfile=/var/log/apache/suexec.log \
  6. # --without-confadjust --without-execstrip \
  7. # --enable-shared=max --enable-rule=SHARED_CHAIN \
  8. # --enable-module=most --enable-module=status \
  9. # --enable-module=log_referer --enable-module=log_agent \
  10. # --enable-module=auth_db \
  11. # --activate-module=src/modules/extra/mod_macro.c
  12. #
  13. # Use this command (before installing) to keep the local suexec across updates:
  14. # dpkg-divert --local --rename --divert /usr/lib/apache/suexec.debian --add /usr/lib/apache/suexec
  15. #
  16. HTTPD_USER="www-data"
  17. LOG_EXEC="/var/log/apache/suexec.log"
  18. DOC_ROOT="/home"
  19. set -e
  20. S=/usr/local/src/apache
  21. B=`pwd`/suexec-build
  22. mkdir $B
  23. #for f in suexec.c suexec.h ap_config.h; do
  24. # zcat $S/$f.gz > $B/$f
  25. #done
  26. zcat $S/suexec.c.gz > $B/suexec.c
  27. #cp suexec.c $B/suexec.c
  28. zcat $S/ap_config.h.gz > $B/ap_config.h
  29. zcat $S/suexec.h.gz > $B/suexec.h.orig
  30. cat $B/suexec.h.orig | sed \
  31. -e 's!^\(#define HTTPD_USER\).*$!\1 "www-data"!' \
  32. -e 's!^\(#define LOG_EXEC\).*$!\1 "/var/log/apache/suexec.log"!' \
  33. -e 's!^\(#define DOC_ROOT\).*$!\1 "/home"!' \
  34. > $B/suexec.h
  35. gcc -lm -lcrypt -ldb -ldl -I/usr/include/apache-1.3 -o $B/suexec $B/suexec.c