Configuration Arr Three-tier Deployment System
Overview
This articleArticleGuide you to useArrTo configure and deploy a three-tier structure. Layer-3 Deployment SystemWebLayer and applicationProgramLayer and data layer, such:
In this deployment scenario, the static content isTier1Layer serverHostAnd dynamic content isTier2LayerHost.
Prerequisites
This demo requires the following prerequisites:
LInstalledIis7OfWin2008,Or later
LMicrosoft Application Request RoutingAssociated modules
LAt least2Content servers with workstation points and applications deployed
LInArrThe static content on the service must be accessible.
Procedure1-Change the corresponding URL rewrite for static contentRules
In this step,URL rewriteThe rule filters static content based on different extensions. Identify static content based on the file extension, such. JpgOr. Gif. If a static file is stored in a directory, for example/Images/Directory, thenURL rewriteThe rule can also be filtered by directory name.
In this demonstration, we will setURL rewriteRules are based on the extension. Jpg/. CSSAnd directory/Images/To filter. If the requested resource extension is. JpgOr. CSS, The request will be directlyArrThe server is not forwarded to the content server ). Similarly, if the requested resource contains/Images/Path. All other requests will beArrThe server is forwarded to each content server for processing.
Make sure that the static content is inArrThe server can be accessed. The static content can be eitherArrThe local server can also be implemented by the shared directory.
Change through GuiURL rewriteRules:
1.OpenIISManager
2.Open farmMyserverfarm(A farm name created in the previous articles)
3.Shown as follows:
A)
4.Double-clickRouting rules
A)Requests with following extensions are not forwardedInput*. Jpg, *. CSS(Separated by commas)
B)Requests with following patterns are not forwardedInput*/Images /*
C)
5.Make sure the static image has beenArrAfter the server processes the log file, you can view the log file. The default location of the log file isC: \ Inetpub \ logs \ logfiles \. You can see these in the log fileJPG, CSS, ImagesNot processed by the content server.
Command Line Method changeURL rewriteRules:
1.ToAdministratorIdentity to open the command line
2.Navigate to directory% Windir % \ system32 \ inetsrv
3.Run the following command to clear allURL rewriteRules:
A)Appcmd.exe clear config-Section: system. webserver/Rewrite/globalrules
B)Then, change the rule to request these extensions.*. Jpg, *. CSSAnd Path/Images/Resources are not forwarded to the Content Server:
I. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/+ "[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']"/commit: apphost
II. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. match. URL: "*"/commit: apphost
III. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/+ "[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. conditions. [input = 'ext _ {URL} ', negate = 'true', pattern = '*. JPG '] "/commit: apphost
IV. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/+ "[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. conditions. [input = 'ext _ {URL} ', negate = 'true', pattern = '*. CSS '] "/commit: apphost
v. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/+ "[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. conditions. [input = '{URL}', negate = 'true', pattern = '*/images/*'] "/commit: apphost
VI. appcmd.exe set config-Section: system. webserver/Rewrite/globalrules/[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. action. type: "Rewrite"/[name = 'Arr _ myserverfarm_loadbalance ', patternsyntax = 'wildcard', stopprocessing = 'true']. action. URL: "http: // myserverfarm1/{R: 0}"/commit: apphost