IIS Configuration Files

IIS Configuration Files

IIS7 Configuration

  • Settings are stored in a hierarchy of files
  • There are three root configuration files
    • Machine.config
    • Web.config
    • ApplicationHost.config
  • Web.config files can contain delegated (distributed) configuration settings
    • Can be present in any directory
    • Override the configuration for the URL that corresponds to that directory
    • Settings declared at the root folder of a site apply to all URLs of the site

IIS7 Configuration Paths

  • The paths to the machine.config and root web.config files depend on:
    • Version of the .NET Framework
    • Whether the platform is x32 or x64
    • Example: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\
  • The path to the IIS applicationHost.config file depends on location of Windows folder
    • Example: C:\Windows\system32\inetsrv\applicationHost.config

IIS7 Configuration Settings

  • Machine.config contains .NET Framework settings
  • Root Web.config contains ASP.NET settings
    • Example: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config
  • ApplicationHost.config contains IIS7 settings
    • Settings apply to all sites unless a location tag (element) is used to specify the path to only one site
    • Example: <location path="Default Web Site/site1"> applies only to site1

IIS7 Configuration Strategies for Sitecore

  • Place settings in the configuration file that corresponds to a specific site or virtual directory to create delegated configurations that can be deployed using the xcopy command
  • Place settings in a root configuration file, like applicationHost.config, and use location tags to apply settings for specific lower levels, to create controlled, centralized configurations
  • Select a set of centrally managed configuration settings for the applicationHost.config file, and allow the remaining configuration settings to be set by the application owners in distributed web.config files

Locking IIS Configuration Settings

  • Configuration settings can be locked and unlocked at various levels and scopes
  • Locking down configuration means that it cannot be set at (overridden) by lower-level settings
  • Useful when only some sites and paths should be able to override centrally managed settings
  • Use the <configSections> section at the top of the applicationHost.config file
    • Section locks are specified by the "overrideModeDefault" attribute
    • Set value to Deny to lock
    • Set value to Allow  to unlock
  • Unlocking a configuration setting can only be done at the level where it was locked