and then restart the Apache server. Doing any one of these will render the
suexec facility unusable, and Apache won’t even try to involve it.
To verify that your action has had the desired effect, verify (if you’re
running Apache 1.3.11 or later) with the
“/usr/local/web/apache/bin/httpd -l” command. If
the output says suexec is enabled, you haven’t done enough yet.
The simplest way to verify that suexec is functioning properly
is to install a script that will tell you the username under which it’s being
invoked.
# cd /usr/local/web/apache/cgi-bin/
# cat > showuser.cgi
#!/bin/sh
echo "Content-type: text/plain"
echo ""
echo "Username="'whoami'
EOS
# chmod 755 showuser.cgi
# chown user1.group1 . ./showuser.cgi
(By calling it “showuser.cgi” you can copy it
directly into a user’s directory without having to rename it. Filename
extensions on scripts in ScriptAliased directories are ignored, so
it does no harm to keep the .cgi extension.)
Note that the cgi-bin/ directory isn’t under the DocumentRoot,
which is why the --suexec-docroot value was bumped up one
level–that way it covers both the ServerRoot (including the
cgi-bin/ directory) and the DocumentRoot.
Since there are two ways in which suexec can be invoked, you
should test both of them:
suexecution container (or use anUser andGroup directives to it. Pick some username and group that areScriptAlias directive that points to the directory where you putcgi-bin/ directory and. Ifsuexec log.
suexecutionsuexec will properly handle a CGI script in ashowuser.cgi script into that user’spublic_html/ directory, make sure that both the script and thepublic_html/ directory itself are mode 755 and owned by the user,user/showuser.cgi>. If you get ansuexec logs.Debugging
Debugging a suexec problem can be frustrating, particularly
since almost any problem with a CGI script in a
suexec-enabled environment turns out to be related to the wrapper.
Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved
Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.