After we read the post about Istalling and Using New IIS Services, now we continue with Hosting Applications with IIS 7.5, this is a continuation of my previous post titled Using New IIS Services. The IIS 7 .5 implementation in Windows Server 2008 R2 includes some major enhancements in its application hosting capabilities, as described in the following sections.
Running ASP.Net Applications
One of the most significant improvements in IIS 7.5 is that it now supports ASP .NET applications on computers running the Server Core installation of Windows Server 2008 R2. Server Core is a stripped-down version of the Windows Server operating system that eliminates many roles and features and most of the graphical interface. One of the features not available in Windows Server 2008 Server Core is Microsoft .NET Framework, and IIS requires this fea- ture to support ASP .NET. Because ASP .NET is one of the most commonly used development environments for Web applications today, this was a major shortcoming. However, Windows Server 2008 R2 provides support for .NET Framework 2.0, 3.0, 3.5.1, and 4.0 in Server Core; IIS 7.5 can therefore host ASP .NET applications.
The ASP .NET implementation in IIS 7 .5 also now supports different Common Language Runtime (CLR) versions, enabling administrators to switch versions without modifying the underlying IIS infrastructure. Microsoft has also incorporated this capability into Windows Server 2008 Service Pack 2. You can specify different CLR settings for individual application pools by creating custom ASPNET .config files. To use these files, you add code specifying their locations to the pool’s applicationHost .config file, as in the following example:
<applicationPools>
<add name=”MyApplicationPool” CLRConfigFile=”c:\InetPub\CLRConfigFile.txt” />
</applicationPools>
IIS 7.5 also includes a new application auto-start feature in its ASP .NET 4.0 implementation. This feature enables an administrator to configure an application pool to start up automatically, while temporarily not processing HTTP requests. This allows applications requiring extensive initialization to finish loading the data they need or to complete other processes before they begin accepting HTTP requests. To use this feature, you must add code like the following to the pool’s applicationHost .config file:
<applicationPools>
<add name=”MyApplicationPool” startMode=”AlwaysRunning” />
</applicationPools>
FastCGI Support in IIS 7.5
FastCGI is a language-independent extension to the Common Gateway Interface (CGI) that enables Web servers to execute applications more quickly and efficiently. Unlike CGI, which creates a separate process for each incoming request, FastCGI uses a single process to handle multiple requests. IIS uses FastCGI to support the popular PHP scripting language, which makes it one of the more important features of the product.
IIS 7.5 includes a number of enhancements to its FastCGI support, including the following:
- FastCgI configuration in IIS Manager - The graphical FastCGI administration interface, previously available only in Administration Pack for IIS 7.0, is now fully integrated into the Internet Information Services (IIS) Manager console, as shown in the following graphic.
- Real-time tuning - In the Edit FastCGI Application dialog box, the Max Instances property specifies the maximum number of FastCGI processes that IIS can launch for each application pool. This equates to the maximum number of FastCGI requests that IIS can process simultaneously for that application. The default value is 4, but in IIS 7.5, if you change the value to 0, the FastCGI module automatically shifts the number of requests up and down, based on the current system load and the number of queued requests.
- Configuration file monitoring - In the Edit FastCGI Application dialog box, the Monitor Changes To File property enables you to specify the path to a configuration file, such as Php .ini, for each application. When IIS 7.5 detects a change to the specified file, it recycles the FastCGI processes for that application.
- New error-handling options - IIS 7.5 now provides a choice of four FastCGI error handling options, which you configure in the Edit FastCGI Application dialog box using the Standard Error Mode property. These options enable you to specify what error information IIS logs and how much of it gets returned to users. You can also configure the property to terminate the FastCGI process when an error occurs.
- Failed request tracing - In IIS 7.5, the FastCGI module can send the information in a process’ STDERR stream to the Failed Request Tracing (FREB) logs maintained by IIS for debugging purposes (as long as Failed Request Tracing is enabled).
Using Managed Service accounts
IIS 7.5 can use the managed service accounts—now supported by Active Directory Domain Services in Windows Server 2008 R2—as service identities, thus eliminating problems caused by expired application pool passwords. The Application Pool Identity is a concept first introduced in IIS 7 .0 which IIS uses to set permissions for an application pool’s configuration file. You can also use it for anonymous authentication in place of the IUSR account. In IIS 7.5, the Application Pool Identity is a man- aged service account, and IIS now uses it to run the W3wp .exe worker process in place of the Network Service account introduced in Windows Server 2003.