你如何使用Apache"ScriptInterpreterSource Registry-Strict"指令?

use*_*775 7 apache perl cgi

我在Windows上运行Apache Web服务器,以便处理一些Perl CGI脚本.在生产中这些脚本在linux机器上运行,并且在源代码库中它们都有像shebangs一样#!/usr/bin/perl,但是在我的Windows机器上,shebangs会是#!c:\perl\bin\perl.exe,所以我与源代码库有冲突.

输入Apache ScriptInterpreterSource指令.

我一直试图让它工作,基于我可以谷歌.但到目前为止还没有运气.我有:

  1. 将这些内容添加到适当的指令AllowOverride无
    选项索引FollowSymLinks ExecCGI顺序允许,拒绝允许来自所有ScriptInterpreterSource Registry-Strict

  2. 补充:AddHandler cgi-script .cgi

  3. 编辑了我的注册表并添加了一个新的String

HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command=C:\Perl\bin\perl.exe
Run Code Online (Sandbox Code Playgroud)

现在,我知道只要他们拥有合适的shebang,CGI就可以在这台服务器上运行.

但是当我尝试访问没有shebang的CGI时,apache日志会吐出:

没有为'.cgi'类型的文件找到Exec CGI Verb

任何想法,见解,甚至疯狂的猜测都将不胜感激.

谢谢.

Pow*_*ord 9

听起来像ScriptInterpreterSource行被忽略了.如果它设置为Registry或Registry-Strict,它应该忽略shebang行并使用注册表.

此外,Apache 2.2文档的注册表项位置略有不同:

HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command\(Default) => C:\Perl\bin\perl.exe -wT
Run Code Online (Sandbox Code Playgroud)