Using IIS 7 Configuration History

Published on November 22, 2007 by

Updated on November 22, 2007 by saad

Average Rating  Rate It (3)

RSS

Introduction

In IIS 6.0, administrators had a safety net that allowed them to easily ascertain what changed in IIS's configuration. It was implemented as a history file that could be restored easily as well serving as a usable history of events that happened to your configuration. In case anything went wrong during application installs, upgrades, or individual changes to the metabase, you can restore to a working state.

With IIS7's brand new configuration, we wanted the same "safety net" yet we couldn't use the IIS 6.0 history feature because of changes in our configuration architecture. In IIS 7.0 we have resolved this problem by creating a service that monitors for changes to the master configuration file, ApplicationHost.config, and will periodically create snapshots for you to later retrieve if necessary.

This feature is called IIS7's Configuration History. In this walkthrough, we will illustrate how this feature works.

Tasks in this walkthrough

  • Reviewing configHistory default configuration settings
  • Validating configHistory functionality is working properly
  • Modifying the number of configuration directories (maxHistories) retained and period attributes
  • Changing the default path for configHistory
  • Restoring configuration from a backup file

Task 1: Reviewing configHistory default configuration settings

In this task, you will review the configuration options available after a default IIS7 installation. In later tasks, you will later modify some of these settings to show the flexibility of this feature to fit your environment.

Step 1: Open applicationHost.config

  1. Click Start, click Run, and in the Open: dialog box type notepad and Click OK

    Figure 1: Opening Configuration with Notepad
  2. Click File, then open, and in the File name: dialog box type %windir%\system32\inetsrv\config\applicationHost.config and Click Open

    Figure 2: ApplicationHost.config Path
  3. To locate configHistory section, click CTRL-F and enter configHistory and Click Find Next

After opening the master file, you should see an entry like the following for configHistory:




<sectionGroup name"system.applicationHost>
    <section name="applictionPools" allowDefinition="AppHostOnly" overrideMode="Deny" />
    <section name="configHistory" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
       <section name="customMetadata" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

       <section name="listenerAdapters" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

       <section name="log" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

       <section name="sites" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

       <section name="webLimits" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />

</sectionGroup>

    

You will quickly notice that there are no further settings for this feature in applicationHost.config. This is expected behavior because by default IIS7 uses the values stored in the IIS7 schema. To see the default settings, we will open IIS7's schema file (IIS_schema.xml.)

Step 2: Locate configHistory defaults in IIS schema

  1. Click Start, click Run, and in the Open: dialog box type notepad and Click OK
  2. Click File, then open, and in the File name: dialog box type %windir%\system32\inetsrv\config\schema\iis_schema.xml

    Figure 3: IIS Schema 
  3. To locate configHistory section, click CTRL-F and enter configHistory
  4. On your Windows Server Code Name "Longhorn" server, you should see the following:

    Figure 4: configHistory Schema Definition 

    As you can see, there are four configurable settings (attributes) for the configHistory section:

    Attribute

    Default Setting

    Definition

    enabled

    True

    This value indicates whether configuration history is enabled or disables

    path

    %systemdrive%\inetpub\history

    The path where history directories will be created and stored

    maxHistories

    10

    The maximum number of directories retained by IIS7

    period

    00:02:00

    The time between each check made for changes by IIS7

Summary

This task, albeit simple, shouldn't be overlooked because it offers you direct insight into configuration attributes available for the configHistory section. We will later modify these settings as a demonstration of the features flexibility based on your environment.

Task 2: Validating configHistory functionality is working properly

The primary learning point in this lab is to see configHistory in action. Furthermore, for experienced administrators who understand IIS 6.0's metabase history, this task will aid in learning the differences between the two features.

Metabase history was a file-based, rather than directory-based like IIS7's configuration history. For example, all backups in IIS 6.0 were stored in the same location that wasn't customizable. In IIS7, each unique copy is stored in its own directory at creation time. In this task, we will make some changes to IIS7's configuration file using IIS Manager and review the results of these changes.

Step 1: Create a website

  1. Click Start, Run, and type Inetmgr and Click Ok

    Figure 5: Opening IIS Manager
  2. Double-click on your server name, for example IIs7Server, to expand the navigation tree
  3. Right-click on the server, and choose Add Web Site…

    Figure 6: Add Web Site
  4. In the Add Web Site wizard, enter information to create a new Website. For example:

    Figure 7: Add Web Site Wizard
  5. Click Ok
  6. You should now see the new Website created in your IIS Manager, as we do in the following:

Related Content

Comments

  1. Submitted on Jun 26 2008 by
    eryn
    I was recommended to this link, on the possibility it could fix my solution, however it was too late, if there indeed was configuration corruption, all the histories were from yesterday, which is too late because the problem started 2 days ago. Can the default for maxHistories in the schema file not be set to 20 perhaps? For review.

You must Log In to comment.

Page view counter