如何在IIS 7上配置CGI?

Reb*_*ial 3 iis cgi rebol

我这样做了

http://reboltutorial.com/images/rebol-iis.png

正如这里所解释的那样,它适用于IIS 6 http://rebolforum.com/index.cgi?f=printtopic&topicnumber=39&archiveflag=new

我还为应用程序池激活了32位,如此处所述 http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx

但是当浏览到测试脚本它不起作用时,似乎永远不会显示任何内容,那么最后会显示此消息错误:

502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
Run Code Online (Sandbox Code Playgroud)

我在Windows 2008上使用了专用服务器

测试脚本的源代码:

REBOL [Title: "Cgi Test in Rebol"]
print "HTTP/1.0 200 OK^/Content-type:text/html^/^/";
print []
print ["Date/time is:" now]
print []
Run Code Online (Sandbox Code Playgroud)

我应该在服务器故障上询问,而不是在这里似乎没有人知道吗?

end*_*o64 5

最后我得到了答案,以下是步骤:

从管理工具打开服务器管理器 添加角色"Web服务器(IIS)"尝试http://localhost/从您的浏览器.您应该看到IIS7欢迎页面.

将core.exe复制到c:\(或其他位置),右键单击core.exe并打开"属性"窗口,在"安全"选项卡下提供对IUSR_xxxx的"读取和执行"访问权限.(如果您有任何问题,请尝试为每个人提供阅读和执行)

从管理员工具打开"Internet信息服务(IIS)管理器".

单击Default Web Sites,双击Handler Mappings,单击右侧面板中的Add Module Mapping,然后键入以下内容:

Request Path: *.r 
Module: c:\core.exe -cs %s %s 
Name: Rebol 
Run Code Online (Sandbox Code Playgroud)

出现"添加脚本映射"对话框时选择"是".它将在ISAPI和CGI限制列表下添加c:\ core.exe -cs"%s%s".

在wwwroot文件夹下创建一个test.r文件.我的test.r文件包含以下脚本:

 R E B O L [Title: "Server Time"] 
 print "content-type: text/html^/" 
 print [<HTML><BODY>] 
 print ["Date/time is:" now] 
 print [</pre></BODY></HTML>] 
Run Code Online (Sandbox Code Playgroud)

http://localhost/test.r在您的浏览器上输入.如果一切顺利,那么它应该工作.

如果您正在尝试使用View.exe,那么您可能需要将--noinstall放到命令行,否则当View以IUSR_xxx用户帐户启动时,它将打开桌面和安装窗口并保持后台(您可以从任务管理器中看到它).

 c:\view.exe -csi %s %s 
Run Code Online (Sandbox Code Playgroud)

如果脚本位于带空格的路径中,您可能还需要在%s周围加上双引号.使用以下表格:

 c:\core.exe -cs "%s %s" 
Run Code Online (Sandbox Code Playgroud)

而不是这个:

 c:\core.exe "-cs %s %s" (<-- this won't work!)
Run Code Online (Sandbox Code Playgroud)

我希望这将有所帮助.

更新:我在IIS6(Windows 2003 Server)上遇到了问题,当我将其配置为以下时它给出404(它在IIS7上工作,如上所述):

c:\core.exe -cs "%s %s"
Run Code Online (Sandbox Code Playgroud)

但它运行如下:

c:\core.exe" -cs "%s" %s
Run Code Online (Sandbox Code Playgroud)

这是Perl安装的链接. http://www.howtogeek.com/50500/how-to-install-perl-on-iis-6-for-windows-server-2003/