ISAPI_rewrite中文手冊(cè)附多站點(diǎn)配置方法第2/4頁
更新時(shí)間:2007年07月19日 00:00:00 作者:
在NT 2000 XP和2003平臺(tái)上,在系統(tǒng)帳戶下應(yīng)該INETINFO程序應(yīng)該與IIS5以共存模式過濾器運(yùn)行。所以系統(tǒng)帳戶應(yīng)該給予對(duì)所有的ISAPI-REWIRITE DLLS 和所有的HTTPD
強(qiáng)制目的URI在內(nèi)部強(qiáng)制為代理需求并且立即通過ISAPI擴(kuò)展應(yīng)付代理需求,這將允許IIS作為代理服務(wù)器并且重路由到其他站點(diǎn)和服務(wù)器
Pattern
限定規(guī)則表達(dá)式以匹配Request-URI,
FormatString
限定將生成新的URI的FormatString
[Flags]
是一個(gè)下列FLAGS的命令分隔列表
D (Delegate security)
代理模式將試圖以當(dāng)前假冒的用戶資格登陸遠(yuǎn)程服務(wù)器,
C (use Credentials)
代理模式將試圖一在URL或基本授權(quán)頭文件中指定的資格登陸遠(yuǎn)程服務(wù)器,用這個(gè)標(biāo)記你可以使用http://user:password@host.com/path/ syntax 作為URL
F (Follow redirects)
缺省情況下ISAPI_Rewrite 將試圖將MAP遠(yuǎn)程服務(wù)器返回的重定向指令到本地服務(wù)器命名空間,如果遠(yuǎn)程服務(wù)器返回重定向點(diǎn)到那臺(tái)服務(wù)器其他的某個(gè)位置,ISAPI_Rewrite 將修改這一重定向指令指向本服務(wù)器名,這將避免用戶看到真實(shí)(內(nèi)部)服務(wù)器名稱
使用F標(biāo)記強(qiáng)制代理模式內(nèi)部跟蹤遠(yuǎn)程服務(wù)器返回的重定向指令,使用這個(gè)標(biāo)記如果你根本不需要接受遠(yuǎn)程服務(wù)器的重定向指令,在WINHTTP設(shè)置中有重定向限制以避免遠(yuǎn)程重定向循環(huán)
I (ignore case)
不管大小寫強(qiáng)行指定字符匹配
U (Unmangle Log)
當(dāng)URI是源需求而不是重寫需求時(shí)記載URI
O (nOrmalize)
在實(shí)行之前標(biāo)準(zhǔn)化字符串。標(biāo)準(zhǔn)化包括URL-ENCODING,不合法的字符的再移動(dòng)等,這個(gè)標(biāo)記對(duì)于URLS和URLS-ENDODED頭是有用的
CacheClockRate directive
Syntax: CacheClockRate Interval
這個(gè)指令只在GLOBAL配置內(nèi)容中出現(xiàn),如果這個(gè)指令在SITE-LEVEL內(nèi)容中出現(xiàn)將被忽略并把錯(cuò)誤信息寫入httpd.parse.errors 文件
ISAPI_Rewrite caches每次在第一次加載時(shí)配置,使用這個(gè)指令你可以限定當(dāng)一個(gè)特定站點(diǎn)從緩存中清理的不活動(dòng)周期,把這個(gè)參數(shù)設(shè)置的足夠大你可以強(qiáng)制ISAPI_Rewrite 永不清理緩存,記住任何配置文件的改變將在下次請(qǐng)求后立即更新而忽略這個(gè)周期
Interval
限定特定配置被清理出緩存的不作為時(shí)間(以秒計(jì)),缺省值3600(1小時(shí))
EnableConfig and DisableConfig directives
Syntax:
EnableConfig [SiteID|"Site name"]
DisableConfig [SiteID|"Site name"]
對(duì)所選站點(diǎn)激活或不激活SITE-LEVEL配置或者改變?nèi)笔∨渲?,缺省SITE-LEVEL配置不激活,這個(gè)指令只出現(xiàn)在GLOBAL配置內(nèi)容中
SiteID
Numeric metabase identifier of a site
Site name
Name of the site as it appears in the IIS console
不用參數(shù)使用這個(gè)命令將改變?nèi)笔∨渲玫紼NABLE/DISABLE配置進(jìn)程
例子
下面例子將使配置僅作用于ID=1(典型是缺省站點(diǎn))名字是MY SITE的站點(diǎn)
Code:
DisableConfig
EnableConfig 1
EnableConfig"My site"
下邊例子將激活名稱為SOMESITE配置因?yàn)樗指钤O(shè)置重載了缺省設(shè)置
Code:
EnableConfig"Some site"
DisableConfig
EnableRewrite and DisableRewrite directives
Syntax:
EnableRewrite [SiteID|"Site name"]
DisableRewrite [SiteID|"Site name"]
對(duì)所選站點(diǎn)激活或不激活重寫或者改變?nèi)笔∨渲?,缺省重寫配置激活,這個(gè)指令只出現(xiàn)在GLOBAL配置內(nèi)容中
Code:
SiteID
Numeric metabase identifier of a site
Site name
Name of the site as it appears in the IIS console.
不使用參數(shù)這個(gè)命令將全部激活或者不激活
RepeatLimit directive
Syntax: RepeatLimit Limit
這個(gè)指令可以出現(xiàn)在GLOBAL和SITE-LEVEL配置文件中,如果出現(xiàn)在GLOBAL配置文件中竟改變GLOBAL對(duì)于所有站點(diǎn)的限制,出現(xiàn)在SITE-LEVEL配置中竟只改變對(duì)于這個(gè)站點(diǎn)的限制并且這個(gè)限制不能超過GLOBAL限制
ISAPI_Rewrite在實(shí)行規(guī)則時(shí)允許循環(huán),這個(gè)指令允許限制最大可能循環(huán)的數(shù)量,可以設(shè)置為0或1而不支持循環(huán),
LIMIT
限制最大循環(huán)數(shù)量,缺省32
RFStyle directive
Syntax: RFStyle Old | New
Configuration Utility
ISAPI_Rewrite Full包括配置功用(可以在 ISAPI_Rewrite 程序組中啟動(dòng)),它允許你瀏覽測(cè)試狀態(tài)并輸入注冊(cè)碼(如果在安裝過程中沒有注冊(cè)),并且調(diào)整部分與代理模式操作相關(guān)的產(chǎn)品功能,UTILITY是由三個(gè)頁面組成的屬性表
Trial page允許你瀏覽TIRAL狀態(tài)并輸入注冊(cè)碼(如果在安裝過程中沒有注冊(cè))
Settings page
這頁包含對(duì)下列參數(shù)的編輯框
Helper URL
這個(gè)參數(shù)影響過濾器和代理模塊之間的聯(lián)系方式,它即可以是以點(diǎn)做前綴的文件擴(kuò)展名(如 .isrwhlp)也可以是絕對(duì)路徑,
第一種情況下擴(kuò)展名將追加在初始請(qǐng)求URI上并且代理模塊竟通過SCRIPT MAP激活,缺省擴(kuò)展名isrwhlp在安裝進(jìn)程中加在global script map 中,如果你改變這個(gè)擴(kuò)展名或者你的應(yīng)用不繼承g(shù)lobal script map 設(shè)置你應(yīng)該手動(dòng)添加向script map 所需求的入口。這個(gè)應(yīng)該有如下參數(shù)
Code:
Executable: An absolute path to the rwhelper.dll in the short form
Extension: Desired extension (.isrwhlp is default)
Verbs radio button: All Verbs
Script engine checkbox: Checked
Check that file exists checkbox: Unchecked
我們已經(jīng)創(chuàng)建了一個(gè)WSH script proxycfg.vbs ,可以簡(jiǎn)單在一個(gè)a script maps中注冊(cè),她位于安裝文件夾并且可以在命令行一如下方式運(yùn)行
cscript proxycfg.vbs [-r] [MetabasePath]
Optional -r 強(qiáng)制注冊(cè)擴(kuò)展名
Optional MetabasePath parameter allows specification of the first metabase key to process. By default it is "/localhost/W3SVC".
要在所有現(xiàn)存的 script maps 中注冊(cè)你可以以如下命令行激活 script
cscript proxycfg.vbs -r
第二種情況下你應(yīng)該提供一個(gè)URI作為'Helper URL'的值,你也應(yīng)該map 一個(gè) ISAPI_Rewrite的安裝文件夾作為美意個(gè)站點(diǎn)的虛擬文件家
注意:根據(jù)顧客反應(yīng),IIS5(也許包括IIS4)對(duì)長(zhǎng)目錄名有問題。所以我們強(qiáng)烈推薦使用短目錄名
Worker threads limit
這個(gè)參數(shù)限制在代理擴(kuò)展線程池中工作線程數(shù),缺省為0意味著這個(gè)限制等于處理器數(shù)量乘以2
Active threads limit
這個(gè)參數(shù)限制當(dāng)前運(yùn)行線程數(shù),這個(gè)數(shù)量不可大于"Worker threads limit". 缺省0意思是等于處理器數(shù)量
Queue size 這個(gè)參數(shù)定義最大請(qǐng)求數(shù)量,如果你曾經(jīng)看到Queue timeout expired" 信息在 the Application event log中你可以增加這個(gè)參數(shù)
Queue timeout
這個(gè)參數(shù)定義你在內(nèi)部請(qǐng)求隊(duì)列中防止新請(qǐng)求的最大等待時(shí)間,如果你曾經(jīng)看到Queue timeout expired" 信息在 the Application event log中你可以增加這個(gè)參數(shù)
Connect timeout
以毫秒設(shè)定代理模塊連接超時(shí)
Send timeout
以毫秒設(shè)定代理模塊發(fā)送超時(shí)
Receive timeout
以毫秒設(shè)定代理模塊發(fā)送超時(shí)
About page.
It contains copyright information and a link to the ISAPI_Rewrite's web site.
Regular expression syntax
這一部分覆蓋了 ISAPI_Rewrite規(guī)定的表達(dá)句法
Literals
所有字符都是原意除了 ".", "*", "?", "+", "(", ")", "{", "}", "[", "]", "^" and "$".,這些字符在用“\”處理時(shí)是原意,原意指一個(gè)字符匹配自身
Wildcard
The dot character "." matches any single character except null character and newline character
以下為句法
Repeats
A repeat is an expression that is repeated an arbitrary number of times. An expression followed by "*" can be repeated any number of times including zero. An expression followed by "+" can be repeated any number of times, but at least once. An expression followed by "?" may be repeated zero or one times only. When it is necessary to specify the minimum and maximum number of repeats explicitly, the bounds operator "{}" may be used, thus "a{2}" is the letter "a" repeated exactly twice, "a{2,4}" represents the letter "a" repeated between 2 and 4 times, and "a{2,}" represents the letter "a" repeated at least twice with no upper limit. Note that there must be no white-space inside the {}, and there is no upper limit on the values of the lower and upper bounds. All repeat expressions refer to the shortest possible previous sub-expression: a single character; a character set, or a sub-expression grouped with "()" for example.
Examples:
Code:
"ba*" will match all of "b", "ba", "baaa" etc.
"ba+" will match "ba" or "baaaa" for example but not "b".
"ba?" will match "b" or "ba".
"ba{2,4}" will match "baa", "baaa" and "baaaa".
Non-greedy repeats
Non-greedy repeats are possible by appending a '?' after the repeat; a non-greedy repeat is one which will match the shortest possible string.
For example to match html tag pairs one could use something like:
Code:
"<\s*tagname[^>]*>(.*?)<\s*/tagname\s*>"
In this case $1 will contain the text between the tag pairs, and will be the shortest possible matching string.
Parenthesis
Parentheses serve two purposes, to group items together into a sub-expression, and to mark what generated the match. For example the expression "(ab)*" would match all of the string "ababab". All sub matches marked by parenthesis can be back referenced using \N or $N syntax. It is permissible for sub-expressions to match null strings. Sub-expressions are indexed from left to right starting from 1, sub-expression 0 is the whole expression.
Non-Marking Parenthesis
Sometimes you need to group sub-expressions with parenthesis, but don't want the parenthesis to spit out another marked sub-expression, in this case a non-marking parenthesis (?:expression) can be used. For example the following expression creates no sub-expressions:
"(?:abc)*"
Alternatives
Alternatives occur when the expression can match either one sub-expression or another, each alternative is separated by a "|". Each alternative is the largest possible previous sub-expression; this is the opposite behaviour from repetition operators.
Examples:
"a(b|c)" could match "ab" or "ac".
"abc|def" could match "abc" or "def".
Sets
A set is a set of characters that can match any single character that is a member of the set. Sets are delimited by "[" and "]" and can contain literals, character ranges, character classes, collating elements and equivalence classes. Set declarations that start with "^" contain the compliment of the elements that follow.
Examples:
Character literals:
"[abc]" will match either of "a", "b", or "c".
"[^abc] will match any character other than "a", "b", or "c".
Character ranges:
"[a-z]" will match any character in the range "a" to "z".
"[^A-Z]" will match any character other than those in the range "A" to "Z".
Character classes
Character classes are denoted using the syntax "[:classname:]" within a set declaration, for example "[[:space:]]" is the set of all whitespace characters. The available character classes are:
相關(guān)文章
ntoskrnl.exe丟失系統(tǒng)無法啟動(dòng)的解決方法
ntoskrnl.exe文件丟失或損壞,系統(tǒng)無法啟動(dòng)的解決方法2008-08-08局域網(wǎng)遭遇“ARP”病毒的新變種附臨時(shí)解決方法
局域網(wǎng)遭遇“ARP”病毒的新變種附臨時(shí)解決方法...2007-11-11資料:引起內(nèi)存不能“read”的原因及“written”的解決方案
資料:引起內(nèi)存不能“read”的原因及“written”的解決方案...2007-01-01