gpt4 book ai didi

linux - Apache suexec "command not in docroot"

转载 作者:IT王子 更新时间:2023-10-29 01:07:37 27 4
gpt4 key购买 nike

错误信息是:

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/
<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>
[...]

所以,我更喜欢将 Perl 脚本放在 cgi-bin 中,但如果我不能解决这个问题,我可以将所有脚本移至 htdocs。

最佳答案

suEXEC 有自己的 docroot,它完全独立于您在 Apache 配置中配置的内容。你可以通过调用查看 suEXEC 的 docroot 是什么:

suexec -V

为此,您可能需要成为 root 用户。在我的例子中,docroot 是 /var/www。您必须将脚本放在那里。无法通过重新编译 suEXEC 来更改此保存。不要尝试使用符号链接(symbolic link)将您的脚本放在 /var/www(或您的 suEXEC 配置的任何内容)之外。

编辑:正如@insaner 在评论中提到的,该命令可能是 suexec 或者我在至少一台服务器上看到的 suexec2suEXEC 就是 Apache 文档所说的模块/功能。

关于linux - Apache suexec "command not in docroot",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19004550/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com