Ano-Tech Computers
Enter keyword:

Combining RPM Apache with a custom suexec
Problem:
Since suexec does not use a configuration file but rather uses compiled-in settings, in certain scenarios it becomes necessary to recompile suexec to change those settings. However, a full recompile of Apache is a complex task.
 
Solution:
Compile Apache and just copy the suexec file instead of doing a full "make install". Here's the full procedure which worked for me:

1. Download and extract the source file for the Apache version you are running. Don't worry about modules etc, you won't need those.

2. chdir to the directory where you extracted the source
"# cd /usr/src/redhat/SOURCES/apache_1.3.27"

3. Configure the source with respect to suexec. Pay no attention to other Apache settings, we won't be using this httpd binary anyway:
"# ./configure --enable-suexec --suexec-caller=apache --suexec-docroot=/ --suexec-logfile=/var/log/httpd/suexec_log"

4. Compile BUT DO NOT INSTALL Apache!
"# make"

5. Make a backup copy of your original suexec binary:
"# mv /usr/sbin/suexec /usr/sbin/suexec_ORG"

6. Copy the new binary into place:
"# cp ./src/support/suexec /usr/sbin/suexec"

7. Finally, set the correct owhership and permissions:
"# chgrp apache /usr/sbin/suexec"
"# chmod 4510 /usr/sbin/suexec"

8. Watch /var/log/httpd/suexec_log for results as you hit the server
 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles