Recompile suexec to work with Apache Virtual Domains on Fedora

Q. Having problems getting suexec and Apache to work together with your virtual domains ?

A. You need to re-compile suexec to work from a different document root.

Suexec and the Document Root

Basically, suexec is hard coded to work from /var/www/html/ if your virtual domain is using sub directories under another path then you'll get this problem. I like to host each of my domains on a separate user account under /home.

Here's what I use to recompile suexec under Fedora core 5. Incidentally I ran this on a VMWare session on my laptop just to be safe.

Recompiling

Make sure you have gcc installed, if not

yum install gcc

The following creates a new suexec copies it in after backing up your old one. Change the /home on the 4th line to whatever document root you require.

get http://www.apache.org/dist/httpd/httpd-2.0.58.tar.gz
tar -zxvf httpd-2.0.58.tar.gz
cd httpd-2.0.58
./configure --enable-suexec --with-suexec-docroot=/home
make
cp /usr/sbin/suexec /usr/sbin/suexec-
cp support/suexec /usr/sbin/suexec