Skip to contentGo to the directory tree
  1. C:
  2. Windows
  3. System32
  4. inetsrv
  5. config\applicationHost.config
FileRisk: Caution

config\applicationHost.config C:\Windows\System32\inetsrv\config\applicationHost.config

applicationHost.config: the root XML configuration file of IIS (sites, bindings, application pools, modules); IIS applies changes without a restart.

Updated on By AltF4 Formation

What it’s for

applicationHost.config is the top level of IIS 7 and later configuration. It declares sites, their bindings, application pools, modules and handlers, and most global settings. The web.config files of sites and applications only refine what it allows, after machine.config and the .NET Framework root web.config. IIS watches the file and applies any change at once, with no service restart.

What it contains

XML organized in sections, described by the config\schema folder:

  • <sites>: each <site> with its id, bindings and folder (by default %SystemDrive%\inetpub\wwwroot). The id gives the name of the W3SVC<id> log folder.
  • <applicationPools>: identity, CLR version, recycling.
  • <system.applicationHost>: logging (default folder %SystemDrive%\inetpub\logs\LogFiles) and configuration history.
  • <system.webServer>: modules, handlers, request filtering, with section locks (overrideModeDefault).

IIS automatically keeps earlier versions of this file in %SystemDrive%\inetpub\history.

Risks and best practices

  • Invalid XML stops IIS from starting the service or loading sites. Change it through IIS Manager, appcmd or PowerShell rather than by hand, and validate with appcmd list config.
  • Take a named backup before any significant change: appcmd add backup, restored with appcmd restore backup.
  • The file can hold passwords (application pool identity, virtual directory): limit read access and do not publish it as is.
  • With shared configuration, the file is read from a share: a change there is immediate for every server in the group.

Useful commands

Fenêtre de terminal
:: Sites and their IDs
%windir%\system32\inetsrv\appcmd.exe list sites
:: One specific section, as XML
%windir%\system32\inetsrv\appcmd.exe list config -section:system.applicationHost/sites
:: As administrator: backup then restore
%windir%\system32\inetsrv\appcmd.exe add backup "before-change"
%windir%\system32\inetsrv\appcmd.exe restore backup "before-change"
Fenêtre de terminal
# Bindings and physical folders of the sites
Import-Module WebAdministration
Get-Website | Select-Object Name, Id, PhysicalPath, Bindings

Report a mistake