Migration Solutions for ColdFusion Applications to ASP.NET
      
Vince Bonfanti's Weblog

IIS 7.0 Configuration and BlueDragon/CFML

In yesterday's blog entry I discussed the IIS 7.0 integrated request pipeline and the new capabilities we'll be able to provide to BlueDragon/CFML programmers. Today I'd like to take a look at the new IIS 7.0 configuration system and the benefits it will bring to both developers and server administrators when configuring and deploying CFML applications.

The key characteristics of the new IIS 7.0 configuration system are:

  • Configuration settings are stored in clear-text XML files--no more metabase.

  • All IIS and ASP.NET configuration settings are stored in the same XML files.

  • The configuration schema is extensible so that third-party applications--such as BlueDragon--can also store configuration settings in the same XML files alongside IIS and ASP.NET.

  • The configuration files are hierarchical, with a single global configuration file that defines the default configuration settings for the server, and website- and application-level configuration files that can override or extend the global defaults.

  • The server administrator can decide which features can be overridden by website- and application-level configuration files, and which are locked and cannot be overridden.

So what does all this mean, especially for BlueDragon/CFML developers and administrators? The first thing to realize is that every IIS web site and web application automatically contains a separate BlueDragon.NET instance with its own separate configuration settings. This means you can configure datasources, mappings, custom tag paths, etc., and have them apply only to a single web site or individual web application within a web site. Let's take a look at a practical example of how this can be useful.

The global IIS 7.0 configuration is stored in the following file, which can only be accessed by Windows users with administrative privileges:

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

Let's assume you have Mach II version 1.1.1 installed in the following directory:

C:\inetpub\MachII_1_1_1

Now, in order to configure a mapping for Mach II so that all web site and web applications use Mach II version 1.1.1, you'd edit the applicationHost.config file and add the following entry (note there will be other sections within system.webServer in addition to the bluedragon section):

<system.webServer>
    <bluedragon>
        <cfmappings>
            <mapping name="/MachII" directory="C:\inetpub\MachII_1_1_1" />
        </cfmappings>
    </bluedragon>
    .
    .
    .
</system.webServer>

Then, let's say you want to configure a new web site or web application that uses the new Mach II version 1.5, but leave all the other web sites using version 1.1.1. How do you do that? It's simple: create a web.config file and place it in the root directory of your web site or web application. Within the web.config file add the following entry, which overrides the global entry in applicationHost.config (in this case, the bluedragon section is the only one we need to add to system.webServer):

<system.webServer>
    <bluedragon>
        <cfmappings>
            <mapping name="/MachII" directory="C:\inetpub\MachII_1_5" />
        </cfmappings>
    </bluedragon>
</system.webServer>

Now your new web site will use Mach II version 1.5, while all other web sites and web applications will continue to use version 1.1.1. (This example assumes the system administrator has delegated the ability to override the cfmappings configuration setting; a discussion of delegation is beyond the scope of this blog entry, but you can find more information here).

The key point is that it's possible for BlueDragon/CFML developers to configure settings for their own web site or web application by editing their own web.config without having to ask the system administrator to do it for them, and without affecting any other web sites or web applications.

This simple example only gives a tiny glimpse of the new possibilities created by the new IIS 7.0 configuration system; for more detailed information visit the IIS web site. Also, I'm going to discuss this in more detail during my keynote at CFUNITED-07, so be sure to come if you want to learn more.

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
Thanks Vince.. I've been telling CF`ers for a while now that IIS7 just rox and I guess its hard to explain with IIS 6 still in their minds...

Great writeup! and I'll be sure to point folks to this often.

-
Scott Barnes
Web Developer Evangelist
Microsoft.
# Posted By Scott Barnes | 6/22/2007 5:24 AM
@Vince thanks for the details here.

@Scott, I have 4 clients all of whome are using ColdFusion and have had problems connecting ColdFusion to IIS7. I address some of these on this blog article, if you have any insights they are appreciated.

http://www.cfwhisperer.com/post.cfm/apache-on-wind...
# Posted By Mike Brunt | 4/25/2009 6:08 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.2.001. Contact Blog Owner

company media information terms of use privacy policy contact us
This page was dynamically built on the BlueDragon CFML Engine