97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 1 Part I: Introduction and Deployment AL Chapter 1: Background on IIS and New Features in IIS 7.0 CO PY R IG HT ED Chapter 4: Installing IIS 7.0 MA Chapter 3: Planning Your Deployment TE RI Chapter 2: IIS 7.
97823c01.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 3 Background on IIS and New Features in IIS 7.0 Microsoft’s Internet Information Services (IIS) has been around for more than a decade, from its first incarnation in Windows NT 3.51 to the current release of IIS 7.0 on the Windows Server 2008 and Vista platforms.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 4 Part 1: Introduction and Deployment IIS Versions 1.0 to 4.0 IIS was released with Service Pack 3 for Windows NT 3.51, as a set of services providing HTTP, Gopher, and WAIS functionality. Although the functions were there, most users chose alternates from third-party vendors such as O’Reilly’s Website or Netscape’s server.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 5 Chapter 1: Background on IIS and New Features in IIS 7.0 IIS 6.0 IIS 6.0 shipped with Windows Server 2003 editions and Windows XP Professional 64bit edition, which was built on the Windows Server 2003 Service Pack 1 code base. IIS 6.0 was identical among operating system versions, but there were restrictions or expansions depending on the version of Server 2003 under which IIS was running.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 6 Part 1: Introduction and Deployment application pool, providing stability across the server’s sites. In addition, worker processes could be assigned a processor affinity, allowing multiprocessor systems to split the workload. Additional Features As did its predecessors, IIS 6.0 included additional features and functionality.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 7 Chapter 1: Background on IIS and New Features in IIS 7.0 The FTP service that ships with Windows Server 2008 is exactly the same as shipped in Server 2003. However, the Microsoft IIS development team is also shipping a new FTP server that includes many of the enhancements requested over the years. This server ships as a free download from www.iis.net, as will many supported and unsupported tools.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 8 Part 1: Introduction and Deployment Windows Version IIS 7.0 Included Limitations Vista Home Premium Edition Yes Limited to three concurrent requests; no FTP server. Vista Business Edition Yes Limited to 10 concurrent requests. Vista Enterprise Edition Yes Limited to 10 concurrent requests. Vista Ultimate Edition Yes Limited to 10 concurrent requests.
7823c01.qxd:WroxPro 2/4/08 6:47 PM Page 9 Chapter 1: Background on IIS and New Features in IIS 7.0 ment, third-party sources, or even Microsoft. Since these modules and additional programs can be plugged into IIS at any time, without changing core operating system functions, the Microsoft IIS development team can ship additional supported and unsupported modules outside of Microsoft’s standard service pack process. The bottom line is that you get what you need faster. Microsoft’s web site at www.iis.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 10 Part 1: Introduction and Deployment Browser HTTP.SYS Preprocess Headers End Session Authenticate Request Log Response Map URL Determine Handler CGI ISAPI Static File PERL ASPX PHP Map URL Begin Request Authenticate Request Authorize Request End Request Resolve Cache Update Request Cache Handler Mapping Release Request State Trace.exd *.aspx Usapi.dll Figure 1-1 Within the IIS 7.0 pipeline, each process is handled by an individual component.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 11 Chapter 1: Background on IIS and New Features in IIS 7.0 Browser HTTP.SYS Begin Request Authenticate Request Authorize Request Resolve Cache Map Handler Acquire State Pre-execute Handler Execute Handler Trace.exd .
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 12 Part 1: Introduction and Deployment 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.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 13 Chapter 1: Background on IIS and New Features in IIS 7.0 There are two great benefits to this new configuration style in IIS 7.0. The first is that by not using the registry for configuration, deploying a site and applications can be done by using XCopy to transfer both content and configuration settings. This makes deployment across web farms far easier than trying to export/import metabase settings.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 14 Part 1: Introduction and Deployment .... With these simple changes to the configuration files, you’ve added the custom module MyNewModule to IIS, with its own custom schema. Componentization Extensibility doesn’t only apply to configurations. Because of the changes to the request processing pipeline, the core server itself is extensible, using both native and managed code.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 15 Chapter 1: Background on IIS and New Features in IIS 7.0 Minimal Installation IIS 7.0 continues the tradition of its predecessor with minimal installation the default. IIS is not installed with the default operating system install, and a basic install only selects those options needed for serving static HTML files. The installation GUI for IIS 6.0 allowed a choice of eight different options, including installing FTP, whereas IIS 7.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 16 Part 1: Introduction and Deployment Management Delegation Management of IIS in previous versions meant either granting local administrator privileges to the user or working through WMI and ADSI options to directly manage the site configurations. The only other option was for developers to work through the IIS administrators to change configurations — an option that could often be frustrating for both administrators and programmers. IIS 7.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 17 Chapter 1: Background on IIS and New Features in IIS 7.0 To allow the same developer on the same site to enable or disable Windows authentication but not to change the providers element, you could use
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 18 Part 1: Introduction and Deployment control, which was prohibitive in an Internet environment. It also allows, with the extensibility of the pipeline components, developers to create their own authentication schemes and easily apply them to any file or folder on the server. Using ASP.NET Forms authentication for content other than ASP.NET is covered in Chapter 14, “Authentication and Authorization.” Request Filtering IIS 7.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 19 Chapter 1: Background on IIS and New Features in IIS 7.0 Using allow or deny in request filtering doesn’t override any MIME-type settings or other security; it simply evaluates the HTTP request and allows it to be processed or rejects it based on filtering rules.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 20 Part 1: Introduction and Deployment IIS Manager The new IIS Manager for IIS 7.0, shown in Figure 1-4, combines all management functions for both IIS and ASP.NET in one location. Administrators will find the tool much easier to navigate than the MMC from previous IIS versions. Developers will find that they can manage individual sites and applications without needing local administrator access to the server.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 21 Chapter 1: Background on IIS and New Features in IIS 7.0 Figure 1-5 AppCmd.exe Command-Line Utility IIS 7.0 introduces a new command-line utility, AppCmd.exe, which replaces the functionality provided by the various VBScript command-line utilities included with previous versions. AppCmd.exe also expands command-line control to all IIS configuration functions. Creating a new web site from the command line is as easy as appcmd.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 22 Part 1: Introduction and Deployment ASP.NET Management Namespace IIS 7.0 may be configured through the new ASP.NET namespace, Microsoft.Web.Administration, which is used for administration of IIS web sites and servers. This namespace is an addition to the ASP.NET framework that is installed with IIS 7.0. An example of using the Microsoft.Web.Administration namespace would be the creation of a new web site.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 23 Chapter 1: Background on IIS and New Features in IIS 7.0 Set oBinding = oService.Get(“BindingElement”).SpawnInstance_ oBinding.BindingInformation = “*:80:” oBinding.Protocol = “http” oService.Get(“Site”).Create “MyNewSite”, array(oBinding), “C:\inetpub\MyNewSite” oService.Get(“Application”).Create _ “/”, “MyNewSite”, “C:\inetpub\MyNewSite” The WMI provider for IIS 7.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 24 Part 1: Introduction and Deployment IIS 6.0, in case your application is not able to run in the new IIS 7.0 integrated pipeline mode. Secondly, an optional IIS 6.0 Metabase Compatibility module can be installed for those applications or scripts that query the IIS metabase. Installing this module installs an ABO mapper that transparently redirects calls to metabase properties to the corresponding section in the new applicationHost.config file.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 25 Chapter 1: Background on IIS and New Features in IIS 7.0 tion are on a server that was upgraded to Longhorn or have been migrated to a new installation of Longhorn, you may need to create new accounts and assign the correct permissions. The second caveat that will catch you on transfers to a new IIS installation is the modularity of IIS 7.0. On a default install of IIS 7.0, components such as classic ASP, ASP.
97823c01.qxd:WroxPro 2/4/08 6:47 PM Page 26 Part 1: Introduction and Deployment Summar y IIS 7.0 is an evolution of previous IIS versions, building on their strengths while overcoming their weaknesses. Microsoft has listened to user comments on previous versions and responded positively, to make IIS 7.0 the most robust, configurable, and secure version of their web server. In addition, Microsoft has further enhanced the tie between IIS and ASP.NET, making IIS 7.