Datasheet

Using applicationHost.config
The applicationHost.config file, new in IIS 7.0, stores IIS configurations for both the web server and
the process model. Global configurations are now stored in the
%windir%\system32\inetsrv folder in
applicationHost.config. This file has two primary sections:
system.applicationHost — Contains the configurations for the site, application, virtual
directory, and application pools.
system.webServer — Contains the rest of the settings and the global defaults.
Configurations by URL location can also be in
applicationHost.config or in the web.config files
for those locations. This allows administrators to set location defaults on the server, while developers
can be allowed to override those settings as needed. These settings are inherited by the
web.config files
at both the root and application levels. This becomes important in the delegation of settings, since the IIS
administrator can allow developers control over settings in a very granular manner at the application
level, while retaining control for the site level.
The
applicationHost.config file can be used to change the characteristics of an IIS server or site after
IIS has been installed. For example, if you choose to use Windows authentication in an IIS site, you can
use the IIS Manager to add Windows authentication, similar to the manner required with previous ver-
sions of IIS. Or you can use the following code within the
applicationHost.config file to accomplish
the same task for the site named MyWebSite:
<location path=”MyWebSite”>
<system.webServer>
<security>
<authentication>
<windowsAuthentication/>
</authentication>
</security>
</system.webServer>
</location>
Similarly, adding ASP to a site is as simple as
<system.webServer>
<asp/>
</system.webServer>
Configuring application pools is as easy as
<system.applicationHost>
<applicationPools>
<applicationPoolDefaults>
<processModel
userName=”Site1AppPoolUser”
password=”Passw0rd”
/>
</applicationPoolDefaults>
<add name=”Site1AppPool”/>
</applicationPools>
</system.applicationHost>
12
Part 1: Introduction and Deployment
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 12