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

错误信息是:

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

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...