错误信息是:
command not in docroot (/home/site1/cgi-bin/test.pl).
Here我发现了这个:
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
DocumentRoot /home/site1/htdocs
SuexecUserGroup site1 site1
ScriptAlias /cgi-bin/ /home/site1/cgi-bin/
所以,我更喜欢在cgi-bin中使用Perl脚本,但是如果我无法解决这个问题,我可以将所有脚本移动到htdocs.
最佳答案
suEXEC有自己的docroot,它完全独立于你在Apache配置中配置的内容.您可以通过调用来查看suEXEC的docroot是什么:
suexec -V
你可能需要成为root用户.在我的情况下,docroot是/ var / www.你必须把你的脚本放在那里.没有办法改变这个保存重新编译suEXEC.不要尝试使用符号链接将脚本保留在/ var / www之外(或者配置suEXEC的任何内容).
编辑:正如@insaner在评论中提到的那样,命令可能是suexec,或者我在至少一个服务器suexec2上看到过. suEXEC就是Apache文档所称的模块/功能.