错误信息是:
command not in docroot (/home/site1/cgi-bin/test.pl).
在这里我发现了这个:
suexec 要求 CGI 脚本位于服务器的 DocumentRoot(而不是 VirtualHost DocumentRoot)下。但是,VirtualHost DocumentRoot 可以是指向出现在真实 DocumentRoot 下的目录的符号链接。
虚拟主机配置的一部分是:
[...]
DirectoryIndex index.html index.html index.php
DocumentRoot /home/site1/htdocs
SuexecUserGroup site1 site1
ScriptAlias /cgi-bin/ /home/site1/cgi-bin/
<Location /home/site1/cgi-bin>
Options +ExecCGI
</Location>
<Directory /home/site1/>
Options -Includes -Indexes -FollowSymLinks +ExecCGI MultiViews
AddHandler cgi-script .cgi .pl
AllowOverride none
Order allow,deny
Allow from all
</Directory>
[...]
所以,我更喜欢在 cgi-bin 中有 Perl 脚本,但如果我不能解决这个问题,我可以将所有脚本移动到 htdocs。