If you’re a system administrator or a developer who manages multiple IIS servers, you might find yourself in a situation where you need to replicate a configuration across multiple servers. Doing this manually can be a time-consuming process and is prone to errors which in turn could cause issues for your web farm. Fortunately, IIS Shared Configuration can help you streamline the process and make it much more manageable by using the IIS configuration stored on one server and syncing it across the other servers. In this walkthrough I will cover setting up IIS Shared Configuration and discuss some caveats for using it.
What is IIS Shared Configuration?
Originally introduced in IIS 7 with Windows Server 2008, IIS Shared Configuration allows multiple IIS servers to share the same configuration files, making it easier to manage and maintain multiple servers. When using IIS Shared Configuration, all configuration data is stored in a central location, and each IIS server reads the configuration data from that location. This ensures that all servers are using the same configuration, reducing the risk of errors and inconsistencies.
When you enable shared configuration, IIS will create a shared configuration file that contains all the configuration settings for your web server. This file can then be accessed by other servers in your web farm, allowing them to use the same configuration settings.
Enabling IIS Shared Configuration is straight forward. Open IIS Manager on your primary server and click Shared Configuration at the server level under Management.
Before enabling Shard Configuration you have to export the configuration to a folder. This allows the configuration files to be shared between the other servers. Click Export Configuration. In my example I’m using C:\inetpub\SharedConfiguration but it can be any folder on the server and even outside the inetpub folder. The default location is C:\Windows\system32\inetsrv\config\export. Additionally you have to enter a complex password for the encryption keys that will be generated.
Click the checkbox to Enable Shared Configuration and then select the path to the exported configuration files.
Enter the encryption key password that was used when configuration files were exported.
Click OK again.
Close IIS Manager and open it again. You should now see the new configuration that was exported from another server.
Benefits of using IIS Shared Configuration?
There are many benefits of using IIS Shared Configuration
- Improved Server ManagementWith IIS Shared Configuration, you only need to make changes to the configuration in one place, and those changes will be automatically applied to all servers. This reduces the time and effort needed to manage multiple servers and helps ensure that all servers are configured consistently.
- Increased ScalabilityBecause IIS Shared Configuration allows you to manage multiple servers from a central location, it makes it much easier to scale your infrastructure. Adding or removing servers from the cluster becomes a much simpler task, as you only need to make changes to the central configuration.
- Enhanced Security
IIS Shared Configuration can help enhance security by centralizing the management of sensitive configuration data. By storing configuration data in a central location, you can ensure that only authorized users have access to the data, reducing the risk of configuration data being compromised.
- Simplified Configuration
IIS Shared Configuration makes it much easier to manage complex configurations. Rather than having to manage multiple configurations across multiple servers, you can manage one central configuration. This simplifies the configuration process and reduces the likelihood of errors.
Caveats of IIS Shared Configuration
While shared configuration can be a powerful tool for managing web servers, it is important to understand the potential caveats and limitations that come with this feature. Here are some of the key caveats to keep in mind when using IIS shared configuration:
- Configuration file accessWhen using shared configuration, all servers in your web farm must have access to the shared configuration file. This means that you need to ensure that the file share or network drive that stores the configuration file is always accessible and available.
- File lockingWhen multiple servers access the same configuration file, file locking can become an issue. If one server locks the file for writing, other servers may not be able to access the file until the lock is released. This can lead to delays and performance issues. One way to get around this is to replicate the base configuration files to each additional server rather than having them access a central copy. Windows DFS is a solution or alternatively using robocopy could work.
- CompatibilityNot all IIS settings are compatible with shared configuration. Some settings may not be shareable between servers. You need to ensure that all settings you plan to share are compatible with shared configuration. For example Url Rewrite is installed manually as a separate module. It will need to be installed on each server before leveraging Shared Configuration.
- Making changesChanges to server configuration such as adding new feature to IIS will wreak havoc for you if you push the configuration files to a server that hasn’t been updated yet. Always disable Shared Configuration and replication before making changes. Additionally some updates will not be possible when Shared configuration is enabled.
IIS Shared Configuration is a valuable tool for managing multiple IIS servers. By centralizing the configuration data, IIS Shared Configuration can help improve server management, increase scalability, enhance security, and simplify configuration. If you’re managing multiple IIS servers, you should consider using IIS Shared Configuration to streamline your configuration and management processes. Thanks for reading!