This aspect of web farms has improved in IIS 7.0 through the advent of centralized configuration via a UNC share, in which a change in a central master configuration file will propagate across different machines at once without extra tools or programmatic support.
The new IIS 7.0 administration UI includes support for setting up configuration redirection. The UI provides support for exporting configuration files and necessary encryption keys to a specified path.
The steps below use the UI to export the necessary files and setup configuration redirection.
- Open InetMgr.exe – click Start, type Inetmgr.exe into the Start Search box and press Enter.
- When the UI opens, select the server connection in the tree view for which you want to setup configuration redirection.
- Open the Shared Configuration feature.
4. To export the necessary configuration files from the local machine to another location (e.g., a UNC share), click theExport Configuration task on the Actions pane.
6. Next, enable the configuration redirection. Check the Enable shared configuration check box.
7. Before you can click Apply, you must specify the path where the configuration and encryption keys are located and specify the credentials used to access that path. Click Connect As… and enter the credentials.
8. After entering the path and credentials, click Apply to save the settings. The UI checks to ensure that the necessary files exist at the specified location — if they do, the UI asks for the password that was used to password protect the encryption keys.
9. Enter the correct password and click OK to finish setting up the configuration redirection.
The steps above show how to both export the configuration and turn on centralized configuration. However, you only need to export configuration once and then perform steps 6 to 9 on each subsequent machine that will use that centralized configuration.
Some Notes About Using the UI
There are some important things to note about using the UI to enable configuration redirection. When using the setup configuration redirection, the UI expects that the exported files it is being told to use have been exported using the UI. This is because the UI exports and imports items such as the password protected encryption keys using its own custom format.
If you were to manually copy the administration.config and applicationHost.config files to a share and then manually export the encryption keys (as explained in the “Dealing with machine-specific encrypted properties” appendix), you would not be able to use the UI to setup configuration redirection to point to those files; this is due to the fact that the exported encryption keys are not in the format required by the UI.
With configuration being referenced from the back-end, there are two key scenarios that this feature was designed for. These are ways to update configuration in the front-end webservers.
The first way is to edit the applicationHost.config file directly on the fileshare. Once this is done, change notifications take place and the web servers pickup the changes in the file.
The other option is to drop a second applicationHost.config file in the back-end file share and change the web server’s redirection.config file to point to the new version of the file. This is useful for rollback purposes or staged deployments.
This walkthrough introduced the new centralized configuration feature. This feature aids administrators that have homogeneous clusters in a web farm environment and helps set and deploy configuration to all the machines in a seamless way.
Once the feature is setup, whether a change is made in the file at the UNC share, or a server is redirected to another location, the changes are picked up immediately by the webserver. Only the global changes that affect multiple sites and applications will cause them to recycle, but if changes are made in a localized scope, then the rest of the sites and applications will not be restarted. There are several aspects and solutions to deal with configuration and content, its provisioning, changing and deployment. This document only covered the central configuration aspect.