簡體   English   中英

如何在IIS 7上配置CGI?

[英]How to configure CGI on IIS 7?

我這樣做了

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.

我在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 []

我應該在服務器故障上問,而不是因為似乎沒有人知道這里?

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

從管理工具打開服務器管理器 添加角色“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 

出現“添加腳本映射”對話框時選擇“是”。 它將在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>] 

在瀏覽器中輸入http://localhost/test.r 如果一切順利,那么它應該工作。

如果您正在嘗試使用View.exe,那么您可能需要將--noinstall放到命令行,否則當View以IUSR_xxx用戶帳戶啟動時,它將打開桌面和安裝窗口並保持后台(您可以從任務管理器中看到它)。

 c:\view.exe -csi %s %s 

如果腳本位於帶空格的路徑中,您可能還需要在%s周圍加上雙引號。 使用以下表格:

 c:\core.exe -cs "%s %s" 

而不是這個:

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

我希望這將有所幫助。

更新:我在IIS6(Windows 2003 Server)上遇到了問題,當我將其配置為以下時它給出了404(它在IIS7上工作,如上所述):

c:\core.exe -cs "%s %s"

但它運行如下:

c:\core.exe" -cs "%s" %s

這是Perl安裝的鏈接。 http://www.howtogeek.com/50500/how-to-install-perl-on-iis-6-for-windows-server-2003/

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM