How Enkompass Configures Internet Information Server 7 (IIS7)

For Enkompass versions 1.6 – 3.0

Introduction

Enkompass is a multi-server solution which must coordinate websites across several servers. However, during the development of Enkompass, we found IIS7 Shared Configuration to be inadequate for our needs. Specifically:

  • Enkompass needs to prevent website owners from accessing data for each others' websites.
  • The IIS Manager will sometimes lock the IIS7 configuration file (Windows\System32\inetsrv\config\ApplicationHost.config) when it is open. Enkompass needs to be able to save changes to the IIS7 configuration file even while it is being read by another server.
  • The various interfaces to IIS can consume massive amounts of memory, work slowly with a large number of sites, and sometimes write an empty IIS7 configuration file. Since it can take a long time to access and read the IIS7 configuration file, retrieving the settings of many users from the file would tax most systems.

As a result, we created our own system to configure IIS7.

How IIS configures websites

IIS uses 2 main files to configure websites:

File Description
Web.config This file belongs to the website owner and contains the settings for configuring the individual website. Visual Studio typically creates this file when a website project is published. Enkompass will modify a few settings in this file when using Deny IP and Password Protect Directories. You can freely edit this file, but if you replace the file, you will lose these settings.
ApplicatioinHost.config This is the main IIS7 configuration file. It contains the settings for running all the websites on a specific server. Enkompass will overwrite any modifications you make to this file. However, you can use our template system to modify the file.

How Enkompass configures IIS

When a web server is installed in the Enkompass Server Manager, Enkompass takes control of maintaining ApplicationHost.config. Enkompass stores the site settings in a database and periodically rewrites ApplicationHost.config if it detects changes to the stored data. By storing multiple changes and writing the file once, Enkompass improves IIS' performance.

IIS reads ApplicationHost.config when it is not busy serving web pages. This time can vary considerably depending on your system. Typically, it takes 4 to 25 minutes.

These changes cause a rewrite of ApplicationHost.config:

  • Creating, modifying, suspending, unsuspending, or terminating an account
  • Adding or removing subdomains, addon domains, parked domains
  • Changing PHP versions
  • Configuring password protected directories
  • Enabling or disabling directory browsing
  • Adding, removing, or modifying MIME types, denied IPs, error pages, redirects, or certificates
  • Adding or removing FTP users

Every time Enkompass replaces ApplicationHost.config, it makes a backup by copying the file and adding the date to the filename.

Enkompass supports multiple servers. Changes to ApplicationHost.config must be coordinated among all the servers. If a website is configured in Enkompass to run on IP addresses assigned to several servers, then the configuration will be set up on each web server. If, however, the website is assigned to only one IP address, then the site will exist only on the server with that IP address.

Changing ApplicationHost.config settings using Enkompass' template system

Enkompass provides a template file on each web server. This template file holds settings for websites that you wish to manage outside of Enkompass. Enkompass will copy this template, add its configuration settings to it, and then replace ApplicationHost.config with this new file.

You can find the template file at Windows\System32\inetsrv\config\enko_applicationHost.config.

We suggest you have a system administrator configure your server with IIS Manager, then copy the settings from ApplicationHost.config into the template file. Changes can reside in the following three sections of the file:

  • <applicationPools>
  • <sites>
  • <location>

Please remember that while the IIS Manager is open on a server, Enkompass may not be able to update ApplicationHost.config on that server.

ALERT! Important: If you edit website settings in ApplicationHost.config, and that site is maintained by Enkompass, then Enkompass will remove your settings.

Configuration File Reference Table

File Description
Web.config This file belongs to the website owner and contains the settings for configuring the individual website. Visual Studio typically creates this file when a website project is published. Enkompass will modify a few settings in this file when using Deny IP and Password Protect Directories. You can freely edit this file, but if you replace the file, you will lose these settings.
Windows\System32\inetsrv\config\ApplicationHost.config This is the IIS configuration file. You should not directly edit this file. Your changes will be overwritten by Enkompass whenever it rewrites ApplicationHost.config.
Windows\System32\inetsrv\config\enko_applicationHost.config This is a template configuration file for IIS provided by Enkompass. You should edit this file. Changes made to this file are automatically applied to ApplicationHost.config whenever it is rewritten.

Topic revision: r6 - 07 Mar 2012 - 20:47:23 - Main.JenniferDoubrava