Ian Purton

Ian Purton’s Notes

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

"Recompile suexec to work with Apache Virtual Domains on Fedora" was published on December 6th, 2006 and is listed in Linux, Webmastering.

Follow comments via the RSS Feed | Leave a comment | Trackback URL

Recompile suexec to work with Apache Virtual Domains on Fedora: 2 Comments

  1. Nico Kadel-Garcia

    This is *BAD* advice. You can in general expect this approach to break the next time you do any Apache RPM updates, because it will overwrite you Apache binaries and skew your suexec version from your underlying Apache versions as you do updates.

    Fortunately for you, the update versions of httpd all include suexec built in. Previous versions of Apache on Fedora Core and RHEL put suexec in the httpd-suex bundle.

    In the future, look up features like this on rpm.pbone.net, which is very useful for hunting up RPM’s that have new features.

  2. I’ve had to do this every time I upgrade from one version of fedora core to another. However, whenever there are updates to httpd within the same version of fedora, all I have to do is recopy the suexec binary created using the steps detailed above. Takes five minutes tops, works every time.

Leave Your Comment

(required)
(required)
 

Subtraction Wordpress Theme by Ian Purton