Skrevet av Emne: Combining RPM Apache with a custom suexec  (Lest 2388 ganger)

ATC

  • Gjest
Combining RPM Apache with a custom suexec
« på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • 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.



    ATC

    • Gjest
    [Solved] Combining RPM Apache with a custom suexec
    « Svar #1 på: 27. ſeptember 2008, 18:24 pm »
  • [applaud]0
  • [smite]0
  • 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