You are on page 1of 13

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Table of Contents
How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 .... 1
Exercise 1 Configuring Disk Cache ................................................................................................................................. 2 Exercise 2 ARR Cache Nodes Hierarchy/Chain .............................................................................................................. 4 Exercise 3 Disk Caching Smooth Streaming Content ..................................................................................................... 6 Exercise 4 Deleting Cached Content ............................................................................................................................ 10

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Objectives

After completing this lab, you will be better able to: Configure and enable a disk cache in application request routing Configure ARR disk cache hierarchy Manage cached content Set up disk caching of Smooth Streaming content

Scenario

In this lab, you will configure disk caching within an application request routing infrastructure. You will also go through a process of setting up a tree-like structure of Application Request Routing (ARR) cache servers in which the cache servers will serve the end user in hierarchy in order to decrease the load on the origin server, that is, our Live Smooth Streaming server. You will also learn how to delete cached content from the ARR cache servers. 60 Minutes

Estimated Time to Complete This Lab Computers used in this Lab

DC

WEB-01

WEB-02

WEB-03 The password for the Administrator account on all computers in this lab is: pass@word1

Page 1 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Exercise 1 Configuring Disk Cache


Scenario
In this exercise, we will first add the server farm, then configure and enable disk cache for ARR. Tasks Complete the following task on: WEB-03
1. Set up a server farm

Detailed Steps
a. Log on to the WEB-03 virtual machine. b. Click Start, then Internet Information Services (IIS) Manager . c. In IIS Manager, expand NYC-WEB-03 in the left pane. d. Right-click Server Farms, then click Create Server Farm. e. Type SharedServers in the Server farm name box, and then click Next. f.

Type NYC-DC-01 in the Server address box, click Add, and then click Finish.

g. Click Yes to confirm the creation of URL Rewrite rules.

Complete the following task on: WEB-03


2. Configure primary

a. In IIS Manager, click NYC-WEB-03, and then double-click Application Request

Routing Cache under the IIS category on the menu window.


b. In the Actions pane, click Add under the Drive Management category. c. In the Add Drive

disk cache location

to use as the cache drive. In this case, browse to C:\DiskCache. Click OK to select this folder.
d. Type 10 in the Maximum size box. e. Click OK and the newly added disk will appear in the list. a. In the Actions pane, click Add Secondary under the Drive Management category. b. In the Add Secondary Drive dialog box, type \\NYC-DC-01\DiskCache2 in the

Complete the following task on: WEB-03


3. Configuring

Drive Location box. You will use this directory on your network as the secondary cache drive in order to emulate an external disk setup which is normally done using SAN.
c. Click OK to save the changes.

secondary disk cache location Complete the following task on: WEB-03
4. Enable disk cache

a. In IIS Manager, click NYC-WEB-03 in the left pane, and then expand Server Farms. b. Click SharedServers, and then double-click Caching under the Server Farm

category.
c. Ensure that the Enable disk cache checkbox is selected.

Complete the following task on: WEB-03


5. Verify the cache

a. In IIS Manager, in the left pane, expand Server Farms if necessary. b. Click SharedServers in the left pane. c. Double-click Monitoring and Management. This screen will populate the server

farm-level runtime statistics, that is, the cache hit/miss ratio, as well as how much bandwidth has been saved because of the ARR disk cache.
d. Open Internet Explorer and browse to http://localhost. Switch to the IIS

functionality

Manager window and refresh the Monitoring and Management console, where you will now see the number of requests and response size.

Page 2 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Detailed Steps
e. Using Windows Explorer, browse to C:\DiskCache\ and you will see the content

being cached. Complete the following task on: WEB-03


6. Remove the server

Note: You will perform the following steps so that the configurations done in the previous exercise do not hinder the upcoming configurations in this demo.
a. Under NYC-WEB-03, click Server Farms, and then click SharedServers. b. Click Remove Server Farm in the Actions pane on the right side. c. Click Yes to confirm. d. In IIS Manager, click NYC-WEB-03. e. Double-click URL Rewrite under the IIS category on the menu window. f.

farm

Make sure that the URL Rewrite list is empty. If you find any rule created, select it, and then click Remove from the Actions pane on the right side.

Note: At this stage you should be all set to perform the next exercise. This step was necessary because the next exercise involves the creation of a new server farm with a different disk cache.

Page 3 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Exercise 2 ARR Cache Nodes Hierarchy/Chain


Scenario
In this exercise, you will configure a child/edge cache node and a parent cache node in a two-tier cache hierarchy deployment. Tasks Complete the following task on: WEB-02
1. Pre-setup

Detailed Steps Note: Your content delivery network (CDN) consists of three servers and a client machine. Each server in the network has a different role as defined as below:
a. Origin server: DC will act as an origin server which will stream a movie to be

accessed by the client node.


b. ARR parent node: WEB-03 will act as the parent node which will either return

verification

cached content or get the content from the origin server as per the request from client node.
c. ARR child node: WEB-01 will act as a child node which the clients will access to

view the streaming movie.


d. Client machine: You will use WEB-02 as a client machine.

Complete the following task on: WEB-02


2. Set up the parent

a. Log on to the WEB-02 virtual machine. Click the WEB-02 virtual machine window

to make the window active, press CTRL+ALT+END, and then log on as woodgrovebank\Administrator , using the password pass@word1.
b. Before you start configuring the farm, verify the behavior: c. Start Internet Explorer , type http://nyc-web-01 in the address bar, and then

farm

press ENTER.
d. You will see a default.html page displaying the text Home page from NYC-WEB-

01. This means that the page is being fetched from the WEB-01.
e. Log on to the WEB-01 virtual machine. f.

On WEB-01 , click Start, and then click Internet Information Services (IIS) Manager.

g. Expand NYC-WEB-01. h. Right-click Server Farms, and then click Create Server Farm. i. j.

Type ParentFarm in the Server farm name field, and then click Next. Type NYC-WEB-03 in the Server address field. Click Add, and then click Finish.

k. Click Yes to confirm the creation of URL Rewrite rules.

Note: At this point you have added a single server as the parent node of this ARR child server. Creating a server farm signifies that you may add multiple parent ARR servers as well. All the parent ARR servers will share one set of configurations whereas all the child ARR servers will share another set of configurations.

Page 4 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Complete the following task on: WEB-01
3. Enable cache array

Detailed Steps
a. In IIS Manager, expand WEB-01 if necessary, and then click and expand the

Server Farms tree.


b. Click ParentFarm in the left pane, and then double-click Load Balance in the

center pane.
c. Select Request hash from the drop-down list. The request hash in ARR Version 2

routing protocol Complete the following task on: WEB-01


4. Configure primary

uses CARP.
d. Click Apply in the Actions pane to save the changes. a. In IIS Manager, click NYC-WEB-01, and then double-click Application Request

Routing Cache under the IIS category on the menu window.


b. In the Actions pane, click Add under the Drive Management category. c. In the Add Drive dialog box, click the ellipsis button (

and secondary disk cache locations

) and browse to a directory to use as the cache drive (in this case, C:\DiskCache). Click OK to select the folder.

d. Type 10 in the Maximum size field. e. Click OK, and the newly added disk will appear in the list. f.

In the Actions pane, click Add Secondary under the Drive Management category.

g. In the Add Secondary Drive dialog box, type \\NYC-DC-01\DiskCache2. h. Click OK, and the newly added disk will appear in the list. a. Switch to the WEB-02 machine. b. Open another instance of Internet Explorer , type http://nyc-web-01 in the

Complete the following task on: WEB-02


5. Verify the parent

address bar, and then press ENTER.


c. Note: You will see a default.html page displaying the text Home page from NYC-

farm Complete the following task on: WEB-01


6. Verify the cache

WEB-03. This signifies that the page is being fetched from the parent server, WEB-03, set up in the previous step. Compare this result with the first step in Task 2.
a. Switch to the WEB-01 machine. b. In IIS Manager, click NYC-WEB-01, and then click Server Farms . c. Click ParentFarm in the left pane. d. Double-click Monitoring and Management. On this screen you can view the

functionality

server farm-level runtime statistics, including the cache hit/miss ratio, and how much bandwidth has been saved due to ARR disk cache.
e. To see some activity on this window, start Internet Explorer and browse to

http://localhost. Then refresh the Monitoring and Management console to see the number of requests and response size. Note: You may repeat Step 5 as often as you like to observe the bandwidth saving statistics in the Monitoring and Management console. Additionally, you could log on to WEB-03 and open the ARR feature to observe that there is only a single request being processed by this server. This ensures that once the content has been cached, it is being served by NYC-WEB-01 instead of routing to NYC-WEB-03 for every request.

Page 5 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Exercise 3 Disk Caching Smooth Streaming Content


Scenario
In this exercise, you will create URL rewrite rules on the child/edge cache node and then configure the parent cache node. These are the final steps in the process of setting up the origin server. You will create, configure, and start a smooth streaming Publishing Point on the origin server and then try to access it from the client machine, NYC WEB 02. This setup will decrease load on the origin server by caching the content into a hierarchy of parent and child cache nodes. Tasks Complete the following task on: WEB-01
1. Create URL Rewrite

Detailed Steps Note: Content delivery networks need more work than just the creation of server farms. Child and parent cache nodes need to have appropriate rewrite rules in order to be able to search effectively for the origin server. The rewrite rule generated by the creation of the server farm is not sufficient for a CDN/ECN deployment because the cache nodes are tiered. When there is a cache miss at the parent cache tier, the next tier of cache nodes (the parent cache nodes) would not know how to find the origin servers. Fo NYC-DC-01 and the content is cached in the hierarchy of ARR cache servers NYC-WEB-01 (child cache) and NYC-WEB-03 (parent cache). If a certain requested image is not found on any cache node, and the URL rewrite rules are not present on the cache nodes, then the child cache node will request the image from the parent node, and the parent node will not know where to find the image. So the URL rewrite rules allow the parent server to look for the origin
a. An origin server is a media-streaming server or a content server of our content

Rules on the child/edge cache node

delivery network. In your case, the origin server is NYC-DC-01. Perform the following steps to configure rewrite rules on your child/edge cache node.
b. Switch to the WEB-01 virtual machine. c. In IIS Manager, click NYC-WEB-01. d. Double-click URL Rewrite under the IIS category from the menu window on the

right side.
e. Select the Rewrite rule that was created after the creation of the new server

farm.
f.

In the Actions pane, click View Rewrite Maps .

g. In the Actions pane, click Add Rewrite Map . h. In the Add Rewrite Map dialog box, name the rewrite map OriginServers. i. j.

Click OK. In the rewrite map, you will explicitly identify the mapping between the host name that the child cache node receives and the corresponding origin host names. In the Actions pane, click Add Mapping Entry. cache node receives in the original value and then type the origin host name in the new value. In the Original value box, type NYC-WEB-02, and then in the New value box, type NYC-DC-01. Click OK.

k. In the Add Mapping Entry dialog box, you will add the host name that the child

l.

In the Actions pane, click Add Mapping Entry .

Page 6 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Detailed Steps
m. In the Original value box, type Localhost, and then in the New value box, type

NYC-DC-01. Click OK.


n. In the Actions pane, click Add Mapping Entry . o. In the Original value box, type NYC-WEB-01 , and then in the New value box, type

NYC-DC-01. Click OK.


p. In the Actions pane, click Edit Map Settings. q. In the Edit Rewrite Map dialog box, type # as the Default value for this rewrite

map.
r. Click OK. s. Click Back to Rules from the Actions pane. t. Locate and select ARR_ParentFarm_loadbalance . u. In the Actions pane, click Edit. v. Click Add Conditions to add two rules. You may have to scroll the center pane to

the right to view this properly.


w. The first rule will use the OriginServers rewrite map that you created in Step 7.

The second rule, which you will now create, will match the host header as the key to match the entries in OriginServers. Click Add, then in the Add Condition dialog box, type the following values:
x. Condition input: {OriginServers:{HTTP_HOST}} y. Check if input string: Matches the pattern z. Pattern: * aa. Ignore Case: Selected bb. Click OK. cc. The second rule will set the default value as # when the host header does not

match the entries in OriginServers. # is not a valid character and cannot be used as a host name. The following rule is used later to ensure that only the customers (as represented by host names) in OriginServers are serviced by ARR. Click Add, then in the Add Condition dialog box, type the following values:
dd. Condition input: {C:1} ee. Check if input string: Does not match the pattern ff. Pattern: # gg. Ignore Case: Selected hh. Click OK. ii. Select the Track capture groups across conditions check box. jj. To set the HTTP_HOST values to match the conditions above, scroll the center

pane to see the Action section and click Server Variables.


kk. In the Server Variables dialog box, type the following values to reset HTTP_HOST: ll. Name: HTTP_HOST mm.

Value: {C:1}

nn. Replace: Checked oo. Click OK to save the changes. pp. In the Actions pane, click Apply.

Note: The focus on the previous steps was to understand the URL rewrite rules on the child/edge cache node. The next steps will focus on the parent cache node so that you get an understanding of how these two work together in a hierarchy.

Page 7 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Complete the following task on: WEB-03
2. Configure the parent

Detailed Steps Note: The parent cache node is, for the most part, configured as a forward proxy.
a. Switch to the WEB-03 machine. b. In IIS Manager, click NYC-WEB-03 and then double-click Application Request

Routing Cache under the IIS category on the menu window.


c. Click Server Proxy Settings in the Actions pane. d. Select the Enable proxy checkbox, and then click Apply in the Actions pane. You

cache node

have just enabled ARR as a proxy at the server level.


e. Click NYC-WEB-03 again, and then double-click URL Rewrite. f.

Click Add Rules in the Actions pane.

g. Select Blank Rule . h. Click OK. i. j.

Type the following values, and then save the rule: In the Name box, type Forward proxy . center pane to the right).

k. In the Using list, select Wildcards (to view this properly you may have to scroll the l.

In the Pattern box, type: * to the right).

m. Click Add Conditions (to view this properly you may have to scroll the center pane n. Click Add, and then type the following Condition: o. Condition input: {HTTP_HOST} p. Type: Matches the pattern q. Pattern: * r. Click OK s. In the Action Type menu, select Rewrite. t. In the Rewrite URL box, type http://{C:1}/{R:0}. u. Click Apply in the Actions pane

Complete the following task on: DC


3. Adding a Live

Note: In the following steps you will configure your origin server. In your content delivery network, this server will act as a content/streaming server.
a. Log on to the DC virtual machine. b. On the Start menu, click Internet Information Services (IIS) Manager . c. In the NYC-DC-01 left pane, expand NYC-DC-01, and then expand the Sites tree. d. Right-click Default Web Site , and then click Add Application. e. Type LiveSmooth in the Alias textbox. f.

Smooth Streaming Publishing Point

In the Physical Path, click the ellipsis button ( ) and browse to C:\Inetpub\wwwroot\LiveSmooth directory. Click OK to select the folder.

g. Click OK. h. Click LiveSmooth in the tree in the left pane. i. j.

In the feature view window, scroll down to Media Services, and double-click Live Smooth Streaming Publishing Points. Click Add in the Actions pane on the right. name box. Leave the title blank.

k. A new Add Publishing Point dialog box will appear. Type LiveSmooth in the File l.

Type 00:10:00 in the estimated duration. This helps the Silverlight client in scaling its Seek bar to the length of the content.

Page 8 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Detailed Steps
m. Select Push in the Live source type drop-down list. n. Click OK to close the dialog box.

Note: The newly created Live Smooth Publishing Point file named LiveSmooth.isml will now show up in the Live Smooth Streaming Publishing Points list in the Stopped state. Complete the following task on: DC
4. Start Publishing a. Select the newly added Publishing Point from the list, and then click Start

Publishing Point in the Actions pane. Note: The newly created Publishing Point is now ready to accept a live stream pushed to it from a Live Smooth Streaming encoder. The state of the Publishing Point will be Starting which signifies that this Publishing Point is waiting for a movie to be pushed. Other property items (Archive, Stream etc.) will be in Stopped state. Note: Now you will configure the Encoder Simulator in order to convert a Smooth Streaming video (ISMV) file to a simulated Live Smooth Streaming output that can be pushed to the newly created Live Smooth Streaming Publishing Point.
a. Open the command prompt. Click Start | Run, type cmd, and then press ENTER. b. On the command prompt, browse to the directory where you installed the

Point Complete the following task on: DC


5. Push a stream to the

Live Smooth Streaming Publishing Point

encoder and sample client files, in this case, C:\Inetpub\wwwroot\LiveSmooth.


c. Type the following command, and then press ENTER to begin encoding simulated

Live Smooth Streaming output from the sample Smooth Streaming video (ISMV):
pushencoder http://localhost/LiveSmooth/LiveSmooth.isml "Big Buck Bunny.ism"

Note: Go back to the IIS management console and view the Publishing Point that you created in the previous exercise. Press F5 and you will see that all the properties of this Publishing Point are Started . You may have to refresh multiple times. Complete the following task on: WEB-02
6. View the Live a. Switch to the WEB-02 machine. b. Start Internet Explorer and type http://nyc-web-01/LiveSmooth in the address

bar, and then press ENTER. Note: The Live Smooth Stream will open in the web browser, using the already installed Silverlight browser plug-in for Live Smooth Streaming. This Smooth Stream is served from the origin server.

Smooth Stream

Page 9 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0

Exercise 4 Deleting Cached Content


Scenario
ARR allows the user to enter a specific/absolute URL or a partial URL with wildcard (*) to delete all contents that match the pattern. This action deletes the content(s) from both the primary cache drive location(s) and the secondary drive, if specified. The ability to delete any specific content could be of great use in large environments where certain unwanted documents or files accidentally get cached. In this exercise, you will remove the cached contents from a disk on Application Request Routing. Tasks Complete the following task on: WEB-01
1. View the cached

Detailed Steps
a. Switch to the WEB-01 machine. b. Open Internet Explorer and browse to http://nyc-web-01/images/

confidential.jpg.
c. This will open an image in the browser. For this scenario you will consider this d. Click Start | Computer and browse to directory C:\DiskCache\NYC-DC-

content

01\images. Note: You will see that the image is being cached.
a. On the Start menu, click Internet Information Services (IIS) Manager . b. Click NYC-WEB-01. c. Double-click Application Request Routing Cache under the IIS category on the

Complete the following task on: WEB-01


2. Delete specific

right side.
d. In the Actions pane, click Delete Specific Cached Objects . e. In the Delete Cached Objects dialog box, type an absolute URL path to the cached

cached objects

content that you want to delete. For this example, type http://nyc-dc-01/images/confidential.jpg , click OK, and then click OK again to confirm. Complete the following task on: WEB-01
3. Verify the cached a. Click Start | Computer , and browse to the C:\DiskCache\NYC-DC-01\images

folder. Note: You will see that the image that was cached is no longer there. You may repeat the above steps for some other sample images as well (for example, iis-logo.jpg, windows7-microsoft.jpg). You can see how these files are cached and deleted one by one. Note: Although the cached version of the image is no longer available, the file still exists at its original place on the origin server NYC-DC-01. The cache will fetch that file again and make it available to the public. To make your (confidential) object/file completely unavailable, you will have to delete/move/rename it at its original location as well.
a. Switch to the DC machine. b. Click Start | Computer and browse to directory C:\inetpub\wwwroot\images\. c. Rename the image named confidential.jpg to confidential1.jpg. d. If you have only deleted the object from the cache, you may try accessing the

object deletion Complete the following task on: DC


4. Make the object

completely inaccessible

image again by refreshing the page five or six times. Page 10 of 11

How to Use and Configure the New Functionality in IIS Application Request Routing v. 2.0 Tasks Detailed Steps
e. After you have refreshed the page a couple of times, the image will be cached

again, and you can verify this by browsing the cache directory C:\DiskCache. However, you performed the last three steps to be sure that your file does not get cached again, which would make it completely inaccessible. Note: If you try to access the image again after performing the last three steps, you will receive a 404 not found error. Switch to the WEB-01 machine, and then refresh or browse to the http://nyc-web-01/images/confidential.jpg page in Internet Explorer

Page 11 of 11

You might also like