Ok. let me first say that I really dont know much about suExec other than what I just read. However, the links that I posted provide ample information regarding compiling, testing, and using suExec. It would be much more helpful if you would post information back as you encounter issues with your installation. I think then you may get a better experience from this message board
(by the way, it really is a great board with lots of talented individuals. Have some patience and follow a step wise approach to your problem and you will be able to overcome it) Based on that however, before anyone can really help you, you must first provide some more information. Such as:
1. What have you done so far other than write the Perl program you posted? What can you tell us about your Apache configuration?
2. Has suExec been compiled with the correct configuration options? If not, see the link that I posted above and it will provide information regarding how to configure suExec.
3. suExec works from user/group/virtual host directives that you define when you compile suExec. You must have compiled these options into your suExec binary.
Note about compiling
Quote:
Because most of suexec's control parameters are defined at compile-time, the only way to change them is to recompile it. And since the wrapper works very closely with the Apache Web server -- to the point of both applications having to share some compile-time definitions -- the way to recompile suexec is to recompile all of Apache. If you've never done this before, you can see a brief treatment of the process in the
Building Apache At Lightspeed appendix of this article.
Testing your configuration
Quote:
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 << EOS
#!/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: Server-wide suexecution & User directory suexecution