I compiled apache with ./configure -prefix=/usr/local/apache2 -enable-so
ever since. But as I needed suexec, it got a bit more complicated.
This is a how-to to compile Apache2 with suexec
1. Go to the apache source directory, where you originally compiled apache. Change to support/
directory in it:
2. Edit the following lines in suexec.h
#define AP_HTTPD_USER "daemon"
(the user that apache runs under)
#define AP_LOG_EXEC "/var/log/apache2/suexec.log"
#define AP_DOC_ROOT "/usr/local/apache2/htdocs"
#define AP_USERDIR_SUFFIX "html"
3. Compile suexec:
4. Copy and chmod suexec:
cp suexec /usr/local/sbin/
chmod 4755 /usr/local/sbin/suexec
6. Now, I compiled Apache again, now with suexec support:
./configure -prefix=/usr/local/apache2 -enable-so --enable-suexec --with-suexec-bin=/usr/local/sbin/suexec
7. I had to compile php again too, because it adds some module into apache2.