加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – apache suexec“命令不在docroot中”

发布时间:2020-12-13 19:04:51 所属栏目:Linux 来源:网络整理
导读:错误信息是: command not in docroot (/home/site1/cgi-bin/test.pl). Here我发现了这个: suexec requires the CGI script to be under the servers DocumentRoot (not the VirtualHost DocumentRoot). It is permitted,however,for the VirtualHost Docum

错误信息是:

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文档所称的模块/功能.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读