microsoft press internet information services iis 70 resource kit phần 1 doc

82 395 0
microsoft press internet information services iis 70 resource kit phần 1 doc

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

PUBLISHED BY Microsoft Press A Division of Microsoft Corporation One Microsoft Way Redmond, Washington 98052-6399 Copyright © 2008 by Microsoft Corporation All rights reserved No part of the contents of this book may be reproduced or transmitted in any form or by any means without the written permission of the publisher Library of Congress Control Number: 2008920571 Printed and bound in the United States of America QWT Distributed in Canada by H.B Fenn and Company Ltd A CIP catalogue record for this book is available from the British Library Microsoft Press books are available through booksellers and distributors worldwide For further information about international editions, contact your local Microsoft Corporation office or contact Microsoft Press International directly at fax (425) 936-7329 Visit our Web site at www.microsoft.com/mspress Send comments to rkinput@microsoft.com Microsoft, Microsoft Press, Active Directory, Internet Explorer, JScript, MSDN, Silverlight, SQL Server, Visual Basic, Visual Studio, Win32, Windows, Windows Media, Windows NT, Windows PowerShell, Windows Server, Windows Vista and Xbox are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries Other product and company names mentioned herein may be the trademarks of their respective owners The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious No association with any real company, organization, product, domain name, e-mail address, logo, person, place, or event is intended or should be inferred This book expresses the author’s views and opinions The information contained in this book is provided without any express, statutory, or implied warranties Neither the authors, Microsoft Corporation, nor its resellers, or distributors will be held liable for any damages caused or alleged to be caused either directly or indirectly by this book Acquisitions Editor: Martin DelRe Developmental Editor: Karen Szall Project Editor: Victoria Thulman Editorial Production: Custom Editorial Productions, Inc Technical Reviewers: Bob Dean, Bob Hogan; Technical Review services provided by Content Master, a member of CM Group, Ltd Cover: Tom Draper Design; illustration by Todd Daman Body Part No X14-14918 Contents at a Glance Part I Part II Part III 10 11 12 13 14 Part IV 15 16 17 Part V A B C D Foundation Introducing IIS 7.0 Understanding IIS 7.0 Architecture 29 Understanding the Modular Foundation 57 Understanding the Configuration System 67 Deployment Installing IIS 7.0 117 Administration Using IIS Manager Using Command Line Tools Remote Administration Managing Web Sites Managing Applications and Application Pools Hosting Application Development Frameworks Managing Web Server Modules Managing Configuration and User Interface Extensions Implementing Security Strategies 153 187 229 259 291 323 367 421 747 Troubleshooting and Performance Logging 535 Tracing and Troubleshooting 563 Performance and Tuning 605 Appendices IIS 7.0 HTTP Status Codes IIS 7.0 Error Messages IIS 7.0 Modules Listing Modules Sequence 657 663 671 683 iii iv Contents at a Glance E F G H I J IIS 7.0 Default Settings and Time-Outs/Thresholds IIS 7.0 and 64-Bit Windows IIS Manager Features to Configuration References IIS 6.0 Metabase Mapping to IIS 7.0 IIS 7.0 Shared Hosting Common Administrative Tasks Using IIS Manager 687 719 723 727 739 745 Table of Contents Acknowledgments xix Introduction xxi What’s New in IIS 7.0 xxi Overview of Book xxii Document Conventions xxiii Reader Aids xxiii Sidebars xxiii Command Line Examples xxiv Companion Media xxiv Find Additional Content Online xxiv Resource Kit Support Policy xxv Part I Foundation Introducing IIS 7.0 Overview of IIS 7.0 What’s New in IIS 7.0 Core Web Server Configuration Administration Tools 10 Diagnostics 13 Windows Process Activation Service 14 Application Compatibility 15 Basic Administration Tasks 15 Creating a Web Site 15 Creating an Application 17 Creating a Virtual Directory 19 What you think of this book? We want to hear from you! Microsoft is interested in hearing your feedback so we can continually improve our books and learning resources for you To participate in a brief online survey, please visit: www.microsoft.com/learning/booksurvey/ v vi Table of Contents Creating an Application Pool 20 Assigning an Application to an Application Pool 21 IIS 7.0 Features in Windows Server 2008 and Windows Vista 22 Summary 26 Additional Resources 27 Understanding IIS 7.0 Architecture 29 Overview of IIS 7.0 Architecture 30 IIS 7.0 Core Components 33 HTTP.sys 33 World Wide Web Publishing Service 35 Windows Process Activation Service 37 Configuration Store 38 Worker Process 40 Request Processing in Application Pool 42 Classic Mode 43 NET Integrated Mode 46 Module Scope 51 Module Ordering 51 Non-HTTP Request Processing 53 Summary 55 Additional Resources 56 Understanding the Modular Foundation 57 Concepts 57 The Ideas 58 Types of Modules 58 Modules and Configuration 59 Key Benefits 61 Security 61 Performance 63 Extensibility 63 Built-in Modules 64 Summary 65 Additional Resources 65 Understanding the Configuration System 67 Overview of the Configuration System 68 Configuration File Hierarchy 69 Configuration File Syntax 74 Table of Contents vii The IIS 7.0 Configuration System and the IIS 6.0 Metabase 81 IIS 7.0 and the NET Configuration Systems 83 Editing Configuration 85 Deciding Where to Place Configuration 86 Setting Configuration 87 Understanding Configuration Errors 90 Managing Configuration 94 Backing Up Configuration 94 Using Configuration History 95 Exporting and Importing Configuration 96 Delegating Configuration 97 Sharing Configuration Between Servers 107 Summary 113 Additional Resources 114 Part II Deployment Installing IIS 7.0 117 Planning the Installation 117 Installation Scenarios for IIS 7.0 119 Ways to Install IIS 7.0 131 Using Server Manager 131 Using Package Manager 132 Using ServerManagerCMD 133 Unattended Answer Files 136 Sysprep/New Setup System 138 Auto-Installs 139 Windows Server 2008 Setup for Optional Features 139 Post Installation 140 Folders and Content 141 Registry 142 Services 142 Validation 143 Troubleshooting Installation 143 Event Logs 144 IIS 7.0 Log 144 Other Related Logging Options 144 viii Table of Contents Removing IIS 7.0 145 The User Interface in Windows Server 2008 and Windows Vista 145 Command Line Method 147 Summary 148 Additional Resources 149 Part III Administration Using IIS Manager 153 Overview of IIS Manager 153 Starting IIS Manager 155 IIS Manager User Interface 156 Navigation Toolbar 159 Connections Pane 159 Workspace 162 Actions Pane 174 Understanding Features 175 Feature to Module Mapping 175 Where the Configuration Is Written 177 Feature Scope 180 IIS 7.0 Manager Customization and Extensibility 181 Remote Administration 184 Summary 186 Additional Resources 186 Using Command Line Tools 187 Using Command Line Management Tools 187 Appcmd.exe 189 Getting Started with Appcmd 190 Appcmd Syntax 191 Supported Objects 193 Getting Help 194 Understanding Appcmd Output 196 General Parameters 199 Using Range Operators 200 Avoiding Common Appcmd Pitfalls 201 Using Basic Verbs: List, Add, Set, Delete 201 Using the List Command to List and Find Objects 202 Using the Add Verb to Create Objects 203 Table of Contents ix Using the Set Verb to Change Existing Objects 204 Using the Delete Verb to Remove Objects 205 Working with Configuration 206 Viewing Configuration with the List Config Command 207 Setting Configuration with the Set Config Command 208 Managing Configuration Delegation 212 Managing Configuration Backups 213 Working with Applications, Virtual Directories, and Application Pools 213 Working with Web Server Modules 214 Inspecting Running Worker Processes and Requests 215 Listing Running IIS Worker Processes 215 Listing Currently Executing Requests 215 Working with Failed Request Tracing 217 Turning on Failed Request Tracing 217 Creating Failed Request Tracing Rules 218 Searching Failed Request Tracing logs 220 Microsoft.Web.Administration 222 Creating Sites with MWA 222 Creating Application Pools with MWA 223 Setting Configuration 224 Windows PowerShell and IIS 7.0 225 WMI Provider 226 IIS 7.0 Configuration COM Objects 227 Summary 227 Additional Resources 228 Remote Administration 229 The IIS Manager 230 Web Management Service 230 Installation 231 WMSvc Configuration 232 Managing Remote Administration 240 Using Remote Administration 249 Troubleshooting 252 Logging 254 Summary 257 Additional Resources 257 x Table of Contents Managing Web Sites 259 Web Sites, Applications, Virtual Directories, and Application Pools 259 Web Sites 260 Applications 262 Virtual Directories 264 Application Pools 265 Administrative Tasks 266 Adding a New Web Site 267 Configuring a Web Site’s Bindings 270 Limiting Web Site Usage 273 Configuring Web Site Logging and Failed Request Tracing 275 Starting and Stopping Web Sites 276 Managing Virtual Directories 277 Adding a New Virtual Directory 277 Configuring Virtual Directories 279 Searching Virtual Directories 282 Managing Remote Content 284 Configuring the Application to Use Remote Content 285 Selecting the Security Model for Accessing Remote Content 285 Configuring Fixed Credentials for Accessing Remote Content 287 Granting Access to the Remote Content 288 Summary 289 Additional Resources 289 10 Managing Applications and Application Pools 291 Managing Web Applications 291 Creating Web Applications 292 Listing Web Applications 297 Managing Application Pools 299 Application Pool Considerations 300 Adding a New Application Pool 302 Managing Application Pool Identities 305 Advanced Application Pool Configuration 309 Managing Worker Processes and Requests 315 Monitoring Worker Processes and Requests 316 Summary 320 Additional Resources 321 42 Part I: Foundation and active on a single Web server, both through lower worker process footprint and intelligent worker process management features These improvements make it easier for Web hosting providers to place each individual application into a separate application pool, in order to achieve the maximum security and fault isolation for those applications Be sure to fully utilize the capabilities afforded by application pool isolation when designing your Web application infrastructure Mike Volodarsky IIS Core Server Program Manager Requests within each worker process can be executed in one of two different ways: in NET Integrated mode when both IIS and ASP.NET requests use the same integrated request processing pipeline, or in Classic mode when two separate pipelines are used for IIS and ASP.NET processing You can configure an application pool to determine in which of the two modes to execute ASP.NET requests In the next section, we will focus on the request processing architecture within worker processes serving the application pools Request Processing in Application Pool In IIS 7.0, two modes are available for an application pool: Integrated mode and Classic mode When you configure an application pool with Integrated mode, IIS 7.0 processes ASP.NET requests using the integrated IIS and ASP.NET request processing pipeline When you configure an application pool with Classic mode, IIS 7.0 processes ASP.NET requests using the separate IIS and ASP.NET request processing pipelines, as in IIS 6.0 Application pools configured with different modes can run on the same server machine You can specify the mode for an application pool by configuring the Managed Pipeline Mode setting in IIS Manager To use IIS Manager to configure the ASP.NET processing mode for an application pool, perform the following steps: In IIS Manager, expand the server node and select the Application Pools node in the Connections pane On the Application Pools page, select the application pool you’d like to configure Chapter 2: Understanding IIS 7.0 Architecture 43 In the Actions pane, under Edit Application Pool, select Basic Settings In the Edit Application Pool dialog box, in the Managed Pipeline Mode drop-down list, choose the desired mode (Integrated or Classic) and click OK Classic Mode Classic mode in IIS 7.0 provides backward compatibility with IIS 6.0 When an application pool is in Classic mode, IIS 7.0 processes ASP.NET requests using two separate IIS and ASP.NET request processing pipelines, as in IIS 6.0 To understand Classic mode in IIS 7.0, let’s first look into how ASP.NET requests are processed in IIS 6.0 Figure 2-9 shows ASP.NET request processing in IIS 6.0 In IIS releases up to version 6.0, ASP.NET connects to the Web server as a stand-alone application framework In these releases, ASP.NET is implemented as an IIS Internet Server Application Programming Interface (ISAPI) extension 44 Part I: Foundation Worker Process HTTP Request Begin Request Authenticate Request Basic Authentication Windows (NTLM) Authentication Anonymous Authentication aspnet_isapi.dll Authenticate Request Determine Handler Static File ISAPI Forms Authentication Windows Authentication Map Handler ASPX Log Request End Request HTTP Response Figure 2-9 ASP.NET request processing in IIS 6.0 In IIS 6.0, the ASP.NET ISAPI extension (aspnet_isapi.dll) is responsible for processing the content types that are registered to it, such as ASPX and ASMX For those requests, it offers powerful features, for example, Forms Authentication and Response Output Caching However, only content types registered to ASP.NET can benefit from these services Other content types—including ASP pages, static files, images, and Common Gateway Interface (CGI) applications—have no access to these features at all A request to an ASP.NET content type is first processed by IIS and then forwarded to aspnet_isapi.dll that hosts the ASP.NET application and request processing model This effectively exposes two separate server pipelines, one for native ISAPI filters and extension components, and another for managed application components ASP.NET components execute entirely inside the ASP.NET ISAPI extension and only for requests mapped to ASP.NET in the IIS script map configuration Requests to non-ASP.NET content, such as ASP pages or static files, are processed by IIS or other ISAPI extensions and are not visible to ASP.NET In addition, even for ASP.NET resources, certain functionalities are not available to ASP.NET because of run-time limitations For example, it is not possible to modify the set of outgoing HTTP response headers before they are sent to the client because this occurs after the ASP.NET execution path In IIS 7.0 in Classic mode, ASP.NET requests are also processed using the ASP.NET ISAPI extension, as shown in Figure 2-10 The core Web server in IIS 7.0 is fully componentized, Chapter 2: 45 Understanding IIS 7.0 Architecture whereas in IIS 6.0, it is monolithic However, the ASP.NET requests in Classic mode are processed by asnet_isapi.dll in the same way as in IIS 6.0 After the request has been processed by asnet_isapi.dll, it is routed back through IIS to send the response Worker Process HTTP Request Basic Authentication Begin Request Authenticate Request Authorize Request Windows Authentication Anonymous Authentication Static File Execute Handler ISAPI Update Cache aspnet_isapi.dll Authenticate Request Forms Authentication Windows Authentication Map Handler ASPX Log Request End Request HTTP Response Figure 2-10 ASP.NET request processing in Classic mode in IIS 7.0 Classic mode in IIS 7.0 has the same major limitations as ASP.NET processing in the IIS 6.0 In summary, these limitations are as follows: ■ Services provided by ASP.NET modules are not available to non-ASP.NET requests ■ Some processing steps are duplicated, such as authentication ■ Some settings must be managed in two locations, such as authorization, tracing, and output caching ■ ASP.NET applications are unable to affect certain parts of IIS request processing that occur before and after the ASP.NET execution path due to the placement of the ASP.NET ISAPI extension in the server pipeline Classic mode is provided only for backward compatibility with IIS 6.0 Simply put, you should add an application to an application pool in Classic mode only if the application fails to work in Integrated mode 46 Part I: Foundation Note For more information on application compatibility in IIS 7.0, see Chapter 11, “Hosting Application Development Frameworks.” NET Integrated Mode When an application pool is configured with NET Integrated mode, you can take advantage of the integrated request processing architecture of IIS 7.0 and ASP.NET In IIS 7.0, ASP.NET run time is integrated with the core Web server The IIS and ASP.NET request pipelines are combined, providing a unified (that is, integrated) request processing pipeline that is exposed to both native and managed modules The IIS 7.0 request processing pipeline is implemented by the core Web server engine It enables multiple independent modules to provide services for the same request All of the Web server features are implemented as stand-alone modules There are over 40 separate native and managed modules Each module implements a particular Web server feature or functionality, such as logging or output caching Note For the full list of IIS 7.0 built-in modules, both native and managed, refer to Appendix C, “IIS 7.0 Modules Listing.” Native modules are implemented as dynamic-link libraries (DLLs) based on public IIS 7.0 C++ extensibility APIs Managed modules are implemented as managed NET Framework classes based on the ASP.NET integration model in IIS 7.0 (IIS 7.0 has integrated the existing IHttpModule API for ASP.NET.) Both of these APIs enable modules to participate in the IIS 7.0 request processing pipeline and access all events for all requests An IIS 7.0 integrated request processing pipeline is shown in Figure 2-11 A pipeline is an ordered list consisting of native and managed modules that perform specific tasks in response to requests When a worker process in an application pool receives a request from HTTP.sys, the request passes through an ordered list of stages As a result of processing, the response is generated and sent back to HTTP.sys Each stage in the pipeline raises an event Native and managed modules subscribe to events in the stages of the pipeline that are relevant to them When the event is raised, the native and managed modules that subscribe to that event are notified and their work to process the request The pipeline event model enables multiple modules to execute during request processing Chapter 2: HTTP Request Understanding IIS 7.0 Architecture 47 Worker Process Begin Request Authenticate Request Authorize Request Resolve Cache Map Handler Acquire State Static File Pre-execute Handler ASPX Execute Handler ISAPI Release State CGI Update Cache Log Request End Request HTTP Response Figure 2-11 IIS 7.0 integrated processing pipeline Most of the pipeline events are intended for a specific type of task, such as authentication, authorization, caching, and logging The following list describes stages and corresponding events in the request processing pipeline: ■ Begin Request stage This stage starts request processing The BeginRequest event is raised ■ Authenticate Request stage ■ Authorize Request stage ■ Resolve Cache stage At this stage, ResolveRequestCache event is raised This stage checks This stage authenticates the requesting user The AuthenticateRequest event is raised At this stage, the AuthorizeRequest event is raised This stage checks access to the requested resource for the authenticated user If access is denied, the request is rejected to see if the response to the request can be retrieved from a cache ■ At this stage, the MapRequestHandler event is raised This stage determines the handler for the request Map Handler stage 48 Part I: ■ Foundation Acquire State stage At this stage, the AcquireRequestState event is raised This stage retrieves the required state for the request ■ Pre-execute Handler stage ■ Execute Handler stage ■ Release State stage At this stage, the ReleaseRequestState event is raised This stage At this stage, the PreExecuteRequestHandler event is raised This stage signals that the handler is about to be executed and performs the preprocessing tasks if needed At this stage, the ExecuteRequestHandler event is raised The handler executes and generates the response releases the request state ■ Update Cache stage This stage updates the cache The UpdateRequestCache event is raised ■ Log Request stage ■ End Request stage At this stage, the request is logged The LogRequest event is raised At this stage, the EndRequest event is raised, which signals that the request processing is about to complete Modules that subscribe to an event provide specific services appropriate for the relevant stage in the pipeline For example, Figure 2-12 shows several native and managed modules that subscribe to the AuthenticateRequest event at the Authenticate Request stage, such as the Basic Authentication module, the Windows Authentication module, the ASP.NET Forms Authentication module, and the Anonymous Authentication module Basic, Windows, and Anonymous Authentication modules are native modules, whereas Forms Authentication is a managed module .NET integrated pipeline provides several key advantages over previous versions of IIS, as follows: ■ Allowing services provided by both native and managed modules to apply to all requests All file types can use features that in IIS 6.0 are available only to managed code For example, you can now use ASP.NET Forms authentication and Uniform Resource Locator (URL) authorization for static files, ASP files, CGI, static files, and all other file types in your sites and applications ■ Eliminating the duplication of several features in IIS and ASP.NET For example, when a client requests a managed file, the server calls the appropriate authentication module in the integrated pipeline to authenticate the client In previous versions of IIS, this same request goes through an authentication process in both the IIS pipeline and the ASP.NET pipeline Other unified IIS and ASP.NET functionality includes URL authorization, tracing, custom errors, and output caching Chapter 2: ■ Understanding IIS 7.0 Architecture 49 Managing all of the modules in one location, thus simplifying site and application administration on the server Instead of managing some features in IIS and some in the ASP.NET configuration, there is a single place to implement, configure, monitor, and support server features For example, because of the run-time integration, IIS and ASP.NET can use the same configuration for enabling and ordering server modules, as well as configuring handler mappings ■ Extending IIS with ASP.NET managed modules IIS 7.0 enables ASP.NET modules to plug directly into the server pipeline, in the same way as modules developed with the native C++ IIS API ASP.NET modules can execute in all run-time stages of the request processing pipeline and can be executed in any order with respect to native modules The ASP.NET API has also been expanded to allow for more control over request processing than was previously possible HTTP Request Worker Process Basic Authentication Begin Request Authenticate Request Authorize Request Resolve Cache Map Handler Windows Authentication Forms Authentication Anonymous Authentication Acquire State Pre-execute Handler Execute Handler Release State Update Cache Log Request End Request HTTP Response Figure 2-12 Native and managed modules in the integrated processing pipeline Note For more information on extending IIS 7.0, refer to Chapter 12, “Managing Web Server Modules.” 50 Part I: Foundation How ASP.NET Integration Is Implemented Though native and managed modules implement the same logical module concept, they use two different APIs To enable an integrated pipeline model for both native and managed modules, IIS 7.0 provides a special native module called Managed Engine The Managed Engine module in effect provides an integration wrapper for ASP.NET modules that enables these managed modules to act as if they were native IIS modules and handlers It acts as a proxy for event notifications and propagates a required request state to the managed modules Together with the ASP.NET engine, it sets up the integrated pipeline and is also responsible for reading the managed modules and handlers configuration When a request requires a managed module, the Managed Engine module creates an AppDomain where that managed module can perform the necessary processing, such as authenticating a user with Forms authentication Figure 2-13 shows the Managed Engine module, with the managed Forms Authentication module executing within an AppDomain Worker Process HTTP Request AppDomain Begin Request Authenticate Request Managed Engine Forms Authentication Authorize Request Update Cache Log Request End Request HTTP Response Figure 2-13 Managed Engine module All managed modules are dependent on the Managed Engine module, and they cannot execute without it For the integrated pipeline and ASP.NET applications to work, the Managed Engine module must be installed and enabled in IIS 7.0 In Windows Server 2008, the Managed Engine module is installed as a part of the Role Service component and NET Extensibility Component In Windows Vista, it is installed as a part of the NET Extensibility component Chapter 2: Note Understanding IIS 7.0 Architecture 51 For more information on ASP.NET integration, refer to Chapter 12 Module Scope Modules can be installed and enabled on different levels Modules that are enabled on the server level provide a default feature set for all applications on the server The IIS global configuration store, applicationHost.config, provides the unified list of both native and managed modules Each time WAS activates a worker process, it gets the configuration from the configuration store, and the worker process loads all globally listed modules Native modules can be installed only at the server level They cannot be installed at the application level At the application level, the global native modules that are enabled at the server level can be removed, or those that are installed but not enabled globally can be enabled for that application Managed modules can be added at the server, site, and application levels Application-specific modules are loaded upon the first request to the application Application managed modules can be xcopy-deployed together with other application files You can manage both native and managed modules using the Modules feature in IIS Manager Note For more information on managing modules, refer to Chapter 12 Module Ordering The pipeline model ensures that the typical Web server processing tasks are performed in the correct order For example, authentication must happen before authorization: authenticating the user associated with a request at the Authenticate Request stage has to happen before checking that user’s access to the requested resource at the Authorize Request stage The server uses the sequence of modules list in the configuration section to order module execution within each request processing stage By executing during the relevant stage, the majority of modules automatically avoid ordering problems However, multiple modules that execute within the same stage may have ordering dependencies For example, the built-in authentication modules that run at the Authenticate Request stage should be executed in the strongest to weakest order so that the request is authenticated with the strongest credentials available To manage ordering dependencies, the administrator can control the ordering of modules by changing the order in which they are listed in the section This can be done, for example, using the Modules feature in IIS Manager 52 Part I: Foundation To view, and optionally change, the ordered list of modules for a server, perform the following steps: In IIS Manager, in the Connections pane, select the server node In the server’s home page, open the Modules feature In the Actions pane, click View Ordered List You can change a position of a module in the processing sequence by selecting the module and then using Move Up and Move Down options in the Action pane to move it to the desired position in the list Chapter 2: Understanding IIS 7.0 Architecture 53 Note For information about the default order of built-in modules, refer to Appendix D, “Modules Sequence.” Non-HTTP Request Processing In IIS 7.0, WAS supports non-HTTP protocols, enabling you to use IIS to host non-HTTP– based applications and services The WAS process model generalizes the process model for the HTTP server by removing the dependency on HTTP Because WAS manages application pool configuration and worker processes in IIS 7.0, the same configuration and process model that is used for HTTP can be used for non-HTTP applications All IIS process management features, such as on-demand activation, process health monitoring, enterprise-class manageability, and rapid failure protection, are available to non-HTTP–based applications and services in IIS 7.0 To support services and applications that use protocols other than HTTP and HTTPS, you can use technologies such as Windows Communication Foundation (WCF) The WAS process model enables WCF-based applications and services to use both HTTP and non-HTTP protocols in a hosting environment that supports message-based activation and offers the ability to host a large number of applications on a single machine Windows Communication Foundation ships with protocol adapters that can leverage the capabilities of the WAS, improving the reliability and resource use of WCF services WAS is capable of receiving requests or messages over any protocol, and it supports pluggable activation of arbitrary protocol listeners Protocol listeners receive protocol-specific requests, send them to IIS for processing, and then return responses to requestors With WCF, a listener adapter includes the functionality of a protocol listener Figure 2-14 shows WAS with listener adapters for non-HTTP protocols Svchost.exe WAS Process Manager Configuration Manager Listener Adapter Interface TCP Listener Adapter Named Pipes Listener Adapter MSMQ Listener Adapter Figure 2-14 Non-HTTP protocol support in WAS 54 Part I: Foundation Listener adapters are Windows services that receive messages on specific network protocols and communicate with WAS to route incoming requests to the correct worker process The listener adapter interface is used to communicate activation requests that are received over the supported non-HTTP protocols There are several non-HTTP listener adapters, as follows: ■ NetTcpActivator for TCP protocol ■ NetPipeActivator for Named Pipes ■ NetMsmqActivator for Message Queuing (also known as MSMQ) If you not need HTTP functionality, you can actually run WAS without W3SVC For example, you can manage a Web service through a WCF listener adapter, such as NetTcpActivator, without running W3SVC if you not need to listen for HTTP requests in HTTP.sys The global IIS configuration store, applicationHost.config, can contain configuration for nonHTTP protocols For example, a TCP listener adapter, NetTcpActivator, can be configured based on information that WAS reads from configuration store After NetTcpActivator is configured, it listens for requests that use the TCP protocol When a listener adapter receives a request, WAS starts a worker process so that the listener adapter can pass the request to it for processing This architecture is shown in Figure 2-15 applicationHost.config Svchost.exe w3wp.exe AppDomain WAS Configuration Manager Process Manager AppDomain Listener Adapter Interface AppDomain NetTcpActivator Figure 2-15 Non-HTTP processing in IIS 7.0 Because WAS manages processes for both HTTP and non-HTTP protocols, you can run applications with different protocols in the same application pool For example, you can host an application over both HTTP and TCP protocols In addition to being protocol independent, the WAS process model in IIS 7.0 provides all types of message-activated applications with intelligent resource management, on-demand Chapter 2: Understanding IIS 7.0 Architecture 55 process activation, health-monitoring, and automatic failure detection and recycling It allows these applications to take advantage of the IIS process model without requiring the deployment footprint of a full IIS installation Note For more information on listener adapters, see the article titled “WAS Activation Architecture” at http://go.microsoft.com/fwlink/?LinkId=88413 Summary In this chapter, we looked at the end-to-end request processing architecture of IIS 7.0 IIS 7.0 includes several core components that work together to execute the HTTP request These components are as follows: ■ HTTP.sys, the kernel-level HTTP protocol listener ■ World Wide Web Publishing Service (W3SVC), the HTTP listener adapter ■ Windows Process Activation Service (WAS), which provides process activation and management ■ Configuration store, the distributed XML file–based configuration hierarchy that contains both IIS and ASP.NET settings ■ Worker process, w3wp.exe, the self-contained user mode process that executes HTTP requests and generates responses Each worker process serves one application pool An application pool can be configured in one of two Managed Pipeline modes: Integrated mode and Classic mode Depending on this configuration setting, an ASP.NET request can be executed in one of two ways within the worker process that serves the application pool: ■ In the Integrated mode, IIS and ASP.NET processing is unified into an integrated processing pipeline ■ In the Classic mode, IIS and ASP.NET pipelines are separate, as in IIS 6.0 The integrated processing pipeline provides the foundation for IIS 7.0 modular architecture It exposes the request to more than 40 built-in, self-contained native and managed modules that implement the Web server functionality The key benefits of the integrated processing pipeline are as follows: ■ Enabling services provided by both native and managed modules to apply to all content types ■ Eliminating duplication of features in IIS and ASP.NET 56 Part I: Foundation ■ Managing all of the modules in one location, thus simplifying site and application administration on the server ■ Extending IIS with ASP.NET managed modules In addition to executing HTTP requests, IIS 7.0 supports hosting of non-HTTP applications and services that can take advantage of its process model On the Disc Browse the CD for additional tools and resources Additional Resources These resources contain additional information and tools related to this chapter: ■ For more information about IIS 7.0 configuration system, refer to Chapter 4, “Understanding the Configuration System.” ■ For more information about application compatibility, refer to Chapter 11, “Hosting Application Development Frameworks.” ■ For more information about integrated processing pipeline and managing Web server modules, refer to Chapter 12, “Managing Web Server Modules.” ■ For a full list of IIS 7.0 native and managed modules, refer to Appendix C, “IIS 7.0 Modules Listing.” ■ For the default sequence of IIS 7.0 built-in modules, refer to Appendix D, “Modules Sequence.” ■ For more information on listener adapters, see the article titled “WAS Activation Architecture” at http://go.microsoft.com/fwlink/?LinkId=88413 ... the Internet Information Services (IIS) 7.0 Resource Kit! This book is a detailed technical resource for planning, deploying, and operating Microsoft Internet Information Services (IIS) 7.0, Microsoft? ??s... them to Microsoft Press by using either of the following methods: E-mail: rkinput @microsoft. com Postal Mail: Microsoft Press Attn: Microsoft Internet Information Services 7.0 Resource Kit, Editor... 11 7 Planning the Installation 11 7 Installation Scenarios for IIS 7.0 11 9 Ways to Install IIS 7.0

Ngày đăng: 07/08/2014, 00:22

Tài liệu cùng người dùng

Tài liệu liên quan