Book Image

Microsoft Application Virtualization Cookbook

Book Image

Microsoft Application Virtualization Cookbook

Overview of this book

Table of Contents (17 chapters)
Microsoft Application Virtualization Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Configuring Internet information services


As an alternative to using a simple DFS share, you can also host App-V packages on an Internet Information Services (IIS) web server. Doing this gives you the added benefit of caching the App-V packages in RAM, which allows for multiple loads of the same package on multiple clients to be faster than just hosting the package on a network share.

Using NLB and hosting the packages on a DFS share allows the web servers to have a fault-tolerant configuration.

Getting ready

This recipe assumes that you have provisioned and domain-joined two web servers with the names WEB1 and WEB2, respectively. You will need administrative permissions on both WEB1 and WEB2 as well as the ability to create a DNS entry.

How to do it...

The following list shows you the fundamental steps involved in this recipe and the tasks required to complete this recipe:

  • Provision a DNS entry for the load balancer

  • Install the required Windows server roles on WEB1 and WEB2

  • Create the App-VIIS namespace and replication group on WEB1 and WEB2

  • Configure Network Load Balancing

  • Configure IIS

  • Configure caching

The implementation of the preceding steps is as follows:

  1. On DC, launch the DNS management console, expand Forward Lookup Zones, and right-click on your domain. From the drop-down menu, select New Host (A or AAAA)….

  2. Set the name to appv and the IP address option to 172.16.0.12. Click on Add Host to create the record:

  3. On WEB1 and WEB2, launch PowerShell and run the following command to install the DFS and DFS-R roles along with NLB and IIS:

    Install-WindowsFeature -Name FS-DFS-Namespace, FS-DFS-Replication, Web-Default-Doc, Web-Dir-Browsing, Web-Http-Errors, Web-Static-Content, Web-App-Dev, Web-Http-Logging, Web-Request-Monitor, Web-Performance, NLB -IncludeManagementTools –Restart
    
  4. After allowing the server to restart if required, launch the DFS management console on WEB1, and using steps 3 to 26 of the previous recipe, provision a DFS namespace and replication group with the name App-VIIS and the folder path set to C:\DFSRoots\App-VIIS on WEB1 and WEB2. This namespace and replication group will be used to host the App-V packages on the web servers; however, IIS will be used to present the files to the clients.

  5. We will now configure NLB between WEB1 and WEB2; doing this provides redundancy between the two servers and ensures that under normal conditions, neither server is overloaded with requests.

  6. From the Start screen, launch the Network Load Balancing Manager software:

  7. In the window that appears, select Cluster and then click on New.

  8. In the New Cluster option, connect window enter WEB1 as the host and click on Connect. From the list of interfaces, select the interface with the IP address 172.16.0.5 and click on Next.

    Tip

    In this evaluation environment, only a single network interface has been configured. In a production environment, you would want to have two interfaces, one for the management of the server and another purely for NLB traffic.

  9. From the Host Parameters screen, leave the default settings in place and click on Next.

  10. On the Cluster IP Address screen, add a new IP address and set the IPv4 address option to 172.16.0.12 with 255.255.248.0 as the Subnet mask option:

  11. At the Cluster Parameters option, leave 172.16.0.12 as the IP address and set the Full Internet name to appv.demo.org (as set in step 1 of this recipe). Also, set the Cluster operation mode to Multicast and click on Next.

    Tip

    If you are using hosts with a management and an NLB network adapter, select Unicast as the Cluster operation mode.

  12. Accept the default configuration for Port Rules and click on Finish to create the cluster.

  13. To add WEB2 to the cluster, expand Network Load Balancing Clusters, right-click on appv.demo.org (172.16.0.12), and click on Add Host To Cluster:

  14. In the window that appears, set WEB2 as the host and click on Connect. In the interface with the IP address 172.16.0.6 selected, click on Next.

  15. At the host parameters, accept the defaults (note that the unique host identifier of this server is set to 2) and click on Next.

  16. Accept the defaults for the Port Rules option and click on Finish.

  17. After a short wait, the two hosts will enter the Converged state. This completes the setup of the NLB cluster.

We will now configure the IIS web server on WEB1.

  1. From the Start screen, launch the Internet Information Services management console:

  2. Expand the WEB1 option, go to the Sites option and then right-click on the Default Web Site option and click on Remove.

  3. Click on Application Pools, right-click on DefaultAppPool, and click on Remove.

  4. Right-click on Sites and click on Add Website…

  5. In the Add Website... window, set the Physical path option to the DFS root that you created earlier (C:\DFSRoots\App-VIIS) and the Host name to appv.demo.org. Leave Start Website immediately checked and click on OK.

  6. To allow the server to handle the .appv file type, select WEB1 from the connection tree and then double-click on MIME Types in the Features View option:

  7. In the MIME Types window, click on Add…. In the window that appears, set the File name extension as .appv and the MIME Types option as application/appv.

  8. With IIS configured, we will now set the file cache on the server to allow for large files (up to 4096 MB) to be stored in RAM when served through the web server.

  9. On WEB1, open Notepad from the Start screen and enter the following:

    Windows Registry Editor Version 5.00
    
    [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters]
    "ObjectCacheTTL"=dword:000004b0
    "MaxCachedFileSizeInMB"=dword:00001000
  10. Save the Notepad file to the desktop with the name updatecache.reg, and then double-click on it to run the file; this will in turn add the entries to the registry under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\InetInfo\Parameters parameter.

    Tip

    These additional registry entries extend the file cache up to 4096 MB and allow objects to stay in the cache for up to 120 seconds. Although 4096 is the largest object that can be in the cache, you can extend the period for which it will stay in the cache by altering the ObjectCacheTTL value.

  11. Finally, open the C:\Windows\system32\inetsrv\config\applicationHost.config file in Notepad, search for <serverRuntime />, and replace it with the following:

    <serverRuntime frequentHitTimePeriod="00:00:01" frequentHitThreshold="1" />
  12. The frequentHitThreshold parameter determines how many hits the file receives before it is cached (in this case, only one hit is required), and the frequentHitTimePeriod value determines how many hits the file receives in a time period before it is cached (in this case, in a single second).