Error message is:
command not in docroot (/home/site1/cgi-bin/test.pl).
suexec requires the CGI script to be under the server's DocumentRoot (not the VirtualHost DocumentRoot). It is permitted, however, for the VirtualHost DocumentRoot to be a symlink to a directory that appears under the real DocumentRoot.
DirectoryIndex index.html index.html index.php
SuexecUserGroup site1 site1
ScriptAlias /cgi-bin/ /home/site1/cgi-bin/
Options -Includes -Indexes -FollowSymLinks +ExecCGI MultiViews
AddHandler cgi-script .cgi .pl
Allow from all
suEXEC has its own
docroot which is totally independent of whatever you configure in your Apache config. You can see what
suEXEC's docroot is by calling:
You may need to be root for that. In my case the docroot was
/var/www. You'll have to put your scripts there. There is no way to change this save recompiling
suEXEC. Don't try to use symbolic links to keep your scripts outside of
/var/www (or whatever your
suEXEC is configured to).
Edit: as mentioned by @insaner in the comments the command is probably
suexec or as I have seen on at least one server
suEXEC is just what the Apache documentation calls the module/feature.