SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Introduction

    IIS 7.0 – Modular Architecture

    IIS 7.0 – Extensible Architecture

    IIS 6.0 – Technical Architecture (Refresher)

    IIS 7.0 – Technical Architecture

     IIS 7.0 and ASP.NET Request Processing
    IIS 7.0 and ASP.NET Integration

     Classic Mode
     Integrated Mode (Benefits, Compatibility, App Pools, etc)
    IIS 7.0 and ASP.NET Breaking Changes (Optional)

    Top changes in IIS 7.0 (Optional)

Prior versions of IIS

     Had to install all of the IIS functionalities
     IIS 6.0 was secure (features were turned off)
     The problems?
       The bits got installed anyways (increased foot-print).
       Service Packs had to be installed, even for the features
        which are not being used (increased maintenance).
       The administrators had to maintain the features which
        were never used (increased maintenance).
     Reason?
       Web server architecture was monolithic! (all or nothing)
New version of IIS to rescue!

     IIS 7.0 is modular.
       3 functional areas
       40+ role services (also referred as “features”).
     IIS 7.0 allows you to choose from those features while
      installing IIS.
     Benefits?
       Thin web server with the features which are really
        needed.
       Decreased “foot-print” of your web server.
       Less maintenance – Administrators need not maintain
        features which are not needed.




Web Server
Functional
  Area




             ASP.NET
               Role
              Service
 Prior versions of IIS
   Write ISAPI filters and extensions
   Extensibility code does not run in the managed
    environment, hence no access to .NET classes.
 IIS 7.0 to rescue (once again!)
   Native modules
     C++
     New Object Oriented APIs
   Managed modules
     Any .NET language
     Can access all of the .NET classes
 Couple of important concepts / components in IIS 6.0
     App Pools
     Application Isolation Modes
     HTTP.sys
     WWW (aka W3SVC) Service
 App Pools
   Used for isolating applications from one another and from the
    web server process
   New way of implementing application isolation
 Application Isolation Modes
   Worker Process Isolation mode (default, important to
    understand)
       Multiple App Pools
       Health Monitoring
       Worker Process Recycling
       Web Garden (Pool with more than one Worker Processes)
       Pool Identity
   IIS 5.0 Isolation mode
     Low Isolation (runs in the web service process!)
     Medium Isolation (shared process)
     High Isolation (separate process altogether)
 HTTP.sys
  Kernel level device driver.
  Receives requests; forwards to IIS; returns response.
  Maintains queues; performs caching
 WWW Service (aka W3SVC Service)
  HTTP administration and configuration
  Process (and App Pool) management
  Performance monitoring
 Re-written from scratch – hence new concepts and
  new architecture.
 Important architectural components in IIS 7.0
     Protocol Listeners (HTTP.sys, etc)
     WWW Service (aka W3SVC Service)
     Windows Process Activation Service (WAS)
     Modules
 Protocol Listeners
   Receives requests; forwards to IIS; returns response.
   Maintains queues; performs caching
   More listeners available for other protocols (e.g.
    NetTcpActivator in WCF for net.tcp)
 WWW Service (aka W3SVC Service)
     Compared to IIS 6.0, the responsibilities have been reduced.
     Listener adapter for HTTP.sys
     Configures HTTP.sys (at load time)
     Updates HTTP.sys whenever the configuration changes
     Notifies WAS whenever a request enters the request queue
     Does not manage the application pools and the worker
      processes.
 Windows Process Activation Service (WPAS) (WAS)
  Manage application pools and worker processes (for
   both the HTTP and non-HTTP protocols)
  Can be used without W3SVC! (e.g. web service over TCP)
  Loads configuration stored in applicationHost.config
  Monitors configuration for any changes.
  Informs listener adapters (such as W3SVC) if
   configuration changes.
 Modules
  New concept in IIS 7.0 – borrowed from ASP.NET.
  Most of the web server functionality is built as Modules.
  Two types
    Native
    Managed
  Benefits
    Plug-and-Play modules according to your needs.
    Reduce attack surface and memory foot-print.
    Customize a server to a specific role in your organization
     (application server, web server, ftp server, etc).
    Write custom modules (C++ or any .NET language) to
     replace existing modules or to introduce new features.
 Differences between Native and Managed Modules

         Native Modules                     Managed Modules
                C++                         Any .NET language
        Difficult to develop                  Easy to develop
  Use this for migrating old ISAPI   Use this for add new “features” or
    components over to IIS 7.0            enhancements to IIS 7.0
   Unrestricted access to server     Don’t have unrestricted access to
            resources                  server resources; .NET and
                                        ASP.NET security applies
   Need to be registered with IIS       No need to register with IIS
     <globalModules> node
    Admin rights are needed to        Admin rights are not needed to
     install/enable/un-install           install/enable/un-install
 IIS 7.0 Request Processing
 Classic Mode
 Integrated Mode
    Benefits
    Compatibility
    App Pools
    Enable ASP.NET services for all content
    Enhanced ASP.NET API
    Runtime Integration
    Request Processing
    ASP.NET Breaking Changes
 Classic Mode
   Just like IIS 6.0 Worker
    Process Isolation Mode.
   Integration is based on
    aspnet_isapi.DLL.
   ASP.NET content (.aspx, etc)
    are processed by ASP.NET
    runtime.
   Non ASP.NET content (.htm, etc)
    are processed by IIS.
   Major drawback
     ASP.NET services are not available to non-ASP.NET content
   When to use?
     While porting an IIS 6.0 application that does not work in the Integrated
      Mode. (not recommended)
 Integrated Mode
  Integrates ASP.NET runtime
   with the core server.
  One consolidated pipe-line.
     Similar to ASP.NET pipe-line
      in IIS 6.0.
     Adds new events
     Modules subscribe to events
     IIS core engine calls modules
      whenever the events occur.
 Integrated Mode – Benefits
   ASP.NET services are available to all
    of the content including.asp pages!
   Fully extend IIS with ASP.NET
     No need to write ISAPI
     Now ASP.NET modules
       Directly plug into the server pipe-line.
       Execute in all stages of the request
        processing pipe-line.
       Be executed in any order respective to
        the native modules! (Very important –
        for example, could replace the
        Basic Authentication provided by IIS)
 Integrated Mode – Benefits
   Unified Server Runtime
     Eliminates the duplication of
      features in IIS and ASP.NET.
     Tighter integration allows many
      features to be unified.
       Unified configuration for IIS and
        ASP.NET modules and handlers
       Custom Errors
       Tracing
       Output Caching
 Integrated Mode – Compatibility
   Existing and new applications can
    run side-by-side.
     Existing applications in Classic mode.
     New applications in Integrated mode.
   What is an existing application is
    run in Integrated mode?
     Might or might not work (Depends!)
     Configuration changes b/c of the
       configuration unification.
     Code changes b/c of the new
      runtime architecture and breaking
      changes.
     IIS 7.0 is helpful! Shows detailed errors.
 Integrated Mode – What to fix?
   HTTP Modules
     HTTP Error 500.22
     Reason
       Web.config contains <httpModules>.
     Fix
       Remove <httpModules>.
       Add<system.webServer>/modules.
       Or use appcmd to do it for you.
         appcmd migration config
          quot;Default Web Site/App Namequot;
          -section:httpModules
 Integrated Mode – What to fix?
   HTTP Handlers
     HTTP Error 500.23
     Reason
       Web.config contains <httpHandlers>.
     Fix
       Remove <httpHandlers>.
       Add<system.webServer>/handlers.
       Or use appcmd to do it for you.
         appcmd migration config
          quot;Default Web Site/App Namequot;
          -section:httpHandlers
 Integrated Mode – What to fix?
   Impersonation
     HTTP Error 500.24
     Reason?
       <identity impersonate=“true”/>
        could be problematic. Impersonated
        identity is unavailable until
        PostAuthenticateRequest stage.
     Fix
       Change the code written in
        BeginRequest and
        AuthenticateRequest events to not
        access the impersonated identity.
       See if the code could be moved to
        PostAuthenticateRequest stage.
 Integrated Mode – App Pools
   Use IIS 6.0 Worker Process isolation
    mode.
   Underlying mechanism for
    implementing Classic and
    Integrated modes in IIS 7.0!
   An application pool specifies
     Pool type (Classic vs Integrated)
     .NET Framework Version
 Integrated Mode – App Pools
   Change ASP.NET mode for a pool
     Why?
      To create the appropriate pipe-line.
     How
      Use the Administration tool.
      Use appcmd
        Sets the app pool mode to Integrated
            appcmd set apppool “app pool name”
             /managedPipelineMode:Integrated
        Lists properties that can be set on an
         app pool
            appcmd set apppool “app pool name”
             /?
      Manually change the
       applicationHost.config file.
 Integrated Mode – App Pools
   Change app pool for an application
     Why?
       Allows you to run your application under a
        specific ASP.NET version or a different mode.
        (Don’t use aspnet_regiis to configure
        the ASP.NET version in IIS 7.0)
     How?
       Use the Administration tool.
       Use appcmd
         Sets the app pool mode to Integrated
          appcmd set apppool “app pool name”
          /managedPipelineMode:Integrated
         Lists properties that can be set on an app
          pool
          appcmd set apppool “app pool name” /?
       Manually change the
        applicationHost.config file.
 Integrated Mode – Enable ASP.NET
  services for all of the content
  Not enabled by default.
  For backwards compatibility



       Run this module only for
        the managed requests
 Integrated Mode – Enable ASP.NET
  services for all of the content
 What are Pre-Conditions?
   Answers to some questions.
   IIS 7.0 configures itself based on
    the answers.
   Pre-Conditions specify.
     Process Bitness – bitness32, bitness64
     Managed Extensibility Style –
      integratedMode, ISAPIMode
     .NET Framework Version –
      runtimeVersionv1.1 ,
      runtimeVersionv2.0
     Managed Code Execution –
      managedHandler
 Integrated Mode – Enable ASP.NET
  services for all of the content
 How?
     Change each and every module entry
      and remove the managedHandler
      pre-condition (tedious).
 Integrated Mode – Enable ASP.NET
  services for all of the content
 How?
     Or set the
      runAllManagedModulesForAllRequests
      attribute for the <modules> section
      to true.
 Integrated Mode – Enhanced
  ASP.NET APIs
   APIs are backwards compatible –
    allows existing code to run in IIS.
   New APIs have been added; couple
    of existing APIs have been changed.
     HttpResponse.Headers
        Allows changing the response headers
         generated by other applications.
     HttpRequest.Headers
        Now writeable! Allows modules to
         manipulate the incoming request
         headers (e.g. dynamically change the
         Accept-Language header).
     HttpRequest.ServerVariables
        Now writeable! Could be used for passing
         information to other application frameworks,
         such as PHP.
 Breaking Changes
  Passport Authentication
    ASP.NET Error 500
    Reason
      Passport auth not supported on Vista
       and Windows Server 2008.
      Applies to both Classic and Integrated
       modes.
    Fix
      Don’t use Passport authentication!
 Breaking Changes
  Query String > 2048
    HTTP Error 404.15
    Reason
      This is the default limit.
      Applies to both Classic and Integrated
       modes.
    Fix
      Change maxQueryString attribute.
 Breaking Changes
   HttpContext.Current.Request and
    HttpContext.Current.Response in
    Application_Start in global.asax
     ASP.NET YSOD
     Generates error if code tries to access
      these properties.
     Reason
       Application initialization tied to the
        arrival of 1st request – design flaw!
        couples the application initialization
        with the 1st request.
     Fix
       Write a module and move code in the
        BeginRequest stage for performing one
        time initialization.
 Top changes in IIS 7.0
   Simple configurable command line setup
   Great compatibility
     Most of the applications will work.
     Classic mode allows for easy app migration.
     IIS 6.0 meta-base compatibility layer for existing scripts
   No more meta-base
     Clear text schema
     IIS settings are stored in applicationHost.config
       Meta-base for SMTP/FTP/NNTP
   Delegated configuration
     Administrators can now delegate IIS settings to application owner.
     Settings defined in web.config file in application directory.
 Top changes in IIS 7.0
   Appcmd and other new management options
     Manage via the UI
     Manage via the command line (replaces adsutil.vbs, iisapp.vbs, etc).
     Command line management of sites, applications, vdir, app pool,
      etc.
   Failed Request Tracing
   Request Filtering
IIS 7.0 Architecture and Integration with ASP.NET

Weitere ähnliche Inhalte

Was ist angesagt?

Compact, Compress, De-Duplicate (DAOS)
Compact, Compress, De-Duplicate (DAOS)Compact, Compress, De-Duplicate (DAOS)
Compact, Compress, De-Duplicate (DAOS)
Ulrich Krause
 

Was ist angesagt? (20)

Introduction to Hyper-V
Introduction to Hyper-VIntroduction to Hyper-V
Introduction to Hyper-V
 
Introduction to Cloud Computing and Cloud Infrastructure
Introduction to Cloud Computing and Cloud InfrastructureIntroduction to Cloud Computing and Cloud Infrastructure
Introduction to Cloud Computing and Cloud Infrastructure
 
What is active directory
What is active directoryWhat is active directory
What is active directory
 
NIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference ArchitectureNIST Cloud Computing Reference Architecture
NIST Cloud Computing Reference Architecture
 
Storage Area Network (San)
Storage Area Network (San)Storage Area Network (San)
Storage Area Network (San)
 
Windows Server 2016 Webinar
Windows Server 2016 WebinarWindows Server 2016 Webinar
Windows Server 2016 Webinar
 
DAS RAID NAS SAN
DAS RAID NAS SANDAS RAID NAS SAN
DAS RAID NAS SAN
 
Desktop virtualization customer presentation
Desktop virtualization customer presentationDesktop virtualization customer presentation
Desktop virtualization customer presentation
 
Virtualization in cloud computing ppt
Virtualization in cloud computing pptVirtualization in cloud computing ppt
Virtualization in cloud computing ppt
 
Cloud Computing and Data Centers
Cloud Computing and Data CentersCloud Computing and Data Centers
Cloud Computing and Data Centers
 
virtual hosting and configuration
virtual hosting and configurationvirtual hosting and configuration
virtual hosting and configuration
 
Administer Active Directory
Administer Active DirectoryAdminister Active Directory
Administer Active Directory
 
introduction and configuration of IIS (in addition with printer)
introduction and configuration of IIS (in addition with printer)introduction and configuration of IIS (in addition with printer)
introduction and configuration of IIS (in addition with printer)
 
Virtualization.ppt
Virtualization.pptVirtualization.ppt
Virtualization.ppt
 
Virtual Box Presentation
Virtual Box Presentation Virtual Box Presentation
Virtual Box Presentation
 
Virtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of CloudVirtualization, A Concept Implementation of Cloud
Virtualization, A Concept Implementation of Cloud
 
VirtualBox networking explained
VirtualBox networking explainedVirtualBox networking explained
VirtualBox networking explained
 
Compact, Compress, De-Duplicate (DAOS)
Compact, Compress, De-Duplicate (DAOS)Compact, Compress, De-Duplicate (DAOS)
Compact, Compress, De-Duplicate (DAOS)
 
SOA
SOASOA
SOA
 
Basics of storage Technology
Basics of storage TechnologyBasics of storage Technology
Basics of storage Technology
 

Andere mochten auch

Internet Information Server (IIS)
Internet Information Server (IIS)Internet Information Server (IIS)
Internet Information Server (IIS)
Rosariio92
 
Alpha Five v11 and IIS support
Alpha Five v11 and IIS supportAlpha Five v11 and IIS support
Alpha Five v11 and IIS support
Richard Rabins
 
Introduction To Iis 7
Introduction To Iis 7Introduction To Iis 7
Introduction To Iis 7
amit_monty
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarni
webhostingguy
 

Andere mochten auch (20)

Understanding IIS
Understanding IISUnderstanding IIS
Understanding IIS
 
Internet information services(iis)
Internet information services(iis)Internet information services(iis)
Internet information services(iis)
 
Internet Information Server (IIS)
Internet Information Server (IIS)Internet Information Server (IIS)
Internet Information Server (IIS)
 
IIS 7: The Administrator’s Guide
IIS 7: The Administrator’s GuideIIS 7: The Administrator’s Guide
IIS 7: The Administrator’s Guide
 
Alpha Five v11 and IIS support
Alpha Five v11 and IIS supportAlpha Five v11 and IIS support
Alpha Five v11 and IIS support
 
Nagios Conference 2011 - Tony Roman - Cacti Workshop
Nagios Conference 2011 - Tony Roman - Cacti WorkshopNagios Conference 2011 - Tony Roman - Cacti Workshop
Nagios Conference 2011 - Tony Roman - Cacti Workshop
 
IIS7 possibilities
IIS7 possibilitiesIIS7 possibilities
IIS7 possibilities
 
Introduction To Iis 7
Introduction To Iis 7Introduction To Iis 7
Introduction To Iis 7
 
IIS7 For Non IIS PFEs
IIS7 For Non IIS PFEsIIS7 For Non IIS PFEs
IIS7 For Non IIS PFEs
 
IIS PPT (1)
IIS PPT (1)IIS PPT (1)
IIS PPT (1)
 
Apache web-server-architecture
Apache web-server-architectureApache web-server-architecture
Apache web-server-architecture
 
Conference on Nagios: Reinhard Scheck on Cacti
Conference on Nagios: Reinhard Scheck on CactiConference on Nagios: Reinhard Scheck on Cacti
Conference on Nagios: Reinhard Scheck on Cacti
 
1386 voronka[1]
1386 voronka[1]1386 voronka[1]
1386 voronka[1]
 
Troubleshooting ASP.NET and IIS Scalability Hotspots
Troubleshooting ASP.NET and IIS Scalability HotspotsTroubleshooting ASP.NET and IIS Scalability Hotspots
Troubleshooting ASP.NET and IIS Scalability Hotspots
 
UAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time CommunicationsUAV Data Link Design for Dependable Real-Time Communications
UAV Data Link Design for Dependable Real-Time Communications
 
Integrated Modular Avionic(IMA) System Integration Process
Integrated Modular Avionic(IMA) System Integration ProcessIntegrated Modular Avionic(IMA) System Integration Process
Integrated Modular Avionic(IMA) System Integration Process
 
8 fighter aircraft avionics-part i
8 fighter aircraft avionics-part i8 fighter aircraft avionics-part i
8 fighter aircraft avionics-part i
 
9 fighter aircraft avionics-part ii
9 fighter aircraft avionics-part ii9 fighter aircraft avionics-part ii
9 fighter aircraft avionics-part ii
 
Web Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server MaintenanceWeb Server Technologies II: Web Applications & Server Maintenance
Web Server Technologies II: Web Applications & Server Maintenance
 
Apache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya KulkarniApache Web Server Architecture Chaitanya Kulkarni
Apache Web Server Architecture Chaitanya Kulkarni
 

Ähnlich wie IIS 7.0 Architecture And Integration With Asp.Net

CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
Spiffy
 
Building & managing wa app wely
Building & managing wa app   welyBuilding & managing wa app   wely
Building & managing wa app wely
Spiffy
 
Building & Managing Windows Azure
Building & Managing Windows AzureBuilding & Managing Windows Azure
Building & Managing Windows Azure
K.Mohamed Faizal
 
INTRODUCTION TO IIS
INTRODUCTION TO IISINTRODUCTION TO IIS
INTRODUCTION TO IIS
sanya6900
 
Comparing IIS and Apache - Questions and Answers
Comparing IIS and Apache - Questions and AnswersComparing IIS and Apache - Questions and Answers
Comparing IIS and Apache - Questions and Answers
butest
 
IIS 7.0 for Apache Administrators
IIS 7.0 for Apache AdministratorsIIS 7.0 for Apache Administrators
IIS 7.0 for Apache Administrators
butest
 
The art of .net deployment automation
The art of .net deployment automationThe art of .net deployment automation
The art of .net deployment automation
MidVision
 

Ähnlich wie IIS 7.0 Architecture And Integration With Asp.Net (20)

Advanced Asp.Net Concepts And Constructs
Advanced Asp.Net Concepts And ConstructsAdvanced Asp.Net Concepts And Constructs
Advanced Asp.Net Concepts And Constructs
 
IIS 6.0 and asp.net
IIS 6.0 and asp.netIIS 6.0 and asp.net
IIS 6.0 and asp.net
 
Make Web, Not War - Installfest: Extend Your Web Server, Rodney Buike
Make Web, Not War - Installfest: Extend Your Web Server, Rodney BuikeMake Web, Not War - Installfest: Extend Your Web Server, Rodney Buike
Make Web, Not War - Installfest: Extend Your Web Server, Rodney Buike
 
WSS And Share Point For Developers
WSS And Share Point For DevelopersWSS And Share Point For Developers
WSS And Share Point For Developers
 
Iis it-slideshares.blogspot.com
Iis it-slideshares.blogspot.comIis it-slideshares.blogspot.com
Iis it-slideshares.blogspot.com
 
CTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should KnowCTU June 2011 - Things that Every ASP.NET Developer Should Know
CTU June 2011 - Things that Every ASP.NET Developer Should Know
 
Road Show Asp Net
Road Show Asp NetRoad Show Asp Net
Road Show Asp Net
 
Building & managing wa app wely
Building & managing wa app   welyBuilding & managing wa app   wely
Building & managing wa app wely
 
Building & Managing Windows Azure
Building & Managing Windows AzureBuilding & Managing Windows Azure
Building & Managing Windows Azure
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
 
INTRODUCTION TO IIS
INTRODUCTION TO IISINTRODUCTION TO IIS
INTRODUCTION TO IIS
 
IIS for Developers
IIS for DevelopersIIS for Developers
IIS for Developers
 
Comparing IIS and Apache - Questions and Answers
Comparing IIS and Apache - Questions and AnswersComparing IIS and Apache - Questions and Answers
Comparing IIS and Apache - Questions and Answers
 
IIS 7.0 for Apache Administrators
IIS 7.0 for Apache AdministratorsIIS 7.0 for Apache Administrators
IIS 7.0 for Apache Administrators
 
PHP on Windows 2008
PHP on Windows 2008PHP on Windows 2008
PHP on Windows 2008
 
The art of .net deployment automation
The art of .net deployment automationThe art of .net deployment automation
The art of .net deployment automation
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
 
ASP.NET 5 Overview
ASP.NET 5 OverviewASP.NET 5 Overview
ASP.NET 5 Overview
 
SharePoint Connections Coast to Coast Migrating SharePoint 2007 Solutions to ...
SharePoint Connections Coast to Coast Migrating SharePoint 2007 Solutions to ...SharePoint Connections Coast to Coast Migrating SharePoint 2007 Solutions to ...
SharePoint Connections Coast to Coast Migrating SharePoint 2007 Solutions to ...
 
Microsoft Tech Ed 2006 #1
Microsoft Tech Ed 2006 #1Microsoft Tech Ed 2006 #1
Microsoft Tech Ed 2006 #1
 

IIS 7.0 Architecture And Integration With Asp.Net

  • 1.
  • 2. Introduction  IIS 7.0 – Modular Architecture  IIS 7.0 – Extensible Architecture  IIS 6.0 – Technical Architecture (Refresher)  IIS 7.0 – Technical Architecture   IIS 7.0 and ASP.NET Request Processing IIS 7.0 and ASP.NET Integration   Classic Mode  Integrated Mode (Benefits, Compatibility, App Pools, etc) IIS 7.0 and ASP.NET Breaking Changes (Optional)  Top changes in IIS 7.0 (Optional) 
  • 3. Prior versions of IIS   Had to install all of the IIS functionalities  IIS 6.0 was secure (features were turned off)  The problems?  The bits got installed anyways (increased foot-print).  Service Packs had to be installed, even for the features which are not being used (increased maintenance).  The administrators had to maintain the features which were never used (increased maintenance).  Reason?  Web server architecture was monolithic! (all or nothing)
  • 4. New version of IIS to rescue!   IIS 7.0 is modular.  3 functional areas  40+ role services (also referred as “features”).  IIS 7.0 allows you to choose from those features while installing IIS.  Benefits?  Thin web server with the features which are really needed.  Decreased “foot-print” of your web server.  Less maintenance – Administrators need not maintain features which are not needed.
  • 5.  Web Server Functional Area ASP.NET Role Service
  • 6.  Prior versions of IIS  Write ISAPI filters and extensions  Extensibility code does not run in the managed environment, hence no access to .NET classes.  IIS 7.0 to rescue (once again!)  Native modules  C++  New Object Oriented APIs  Managed modules  Any .NET language  Can access all of the .NET classes
  • 7.  Couple of important concepts / components in IIS 6.0  App Pools  Application Isolation Modes  HTTP.sys  WWW (aka W3SVC) Service
  • 8.  App Pools  Used for isolating applications from one another and from the web server process  New way of implementing application isolation  Application Isolation Modes  Worker Process Isolation mode (default, important to understand)  Multiple App Pools  Health Monitoring  Worker Process Recycling  Web Garden (Pool with more than one Worker Processes)  Pool Identity  IIS 5.0 Isolation mode  Low Isolation (runs in the web service process!)  Medium Isolation (shared process)  High Isolation (separate process altogether)
  • 9.  HTTP.sys  Kernel level device driver.  Receives requests; forwards to IIS; returns response.  Maintains queues; performs caching  WWW Service (aka W3SVC Service)  HTTP administration and configuration  Process (and App Pool) management  Performance monitoring
  • 10.  Re-written from scratch – hence new concepts and new architecture.  Important architectural components in IIS 7.0  Protocol Listeners (HTTP.sys, etc)  WWW Service (aka W3SVC Service)  Windows Process Activation Service (WAS)  Modules
  • 11.  Protocol Listeners  Receives requests; forwards to IIS; returns response.  Maintains queues; performs caching  More listeners available for other protocols (e.g. NetTcpActivator in WCF for net.tcp)  WWW Service (aka W3SVC Service)  Compared to IIS 6.0, the responsibilities have been reduced.  Listener adapter for HTTP.sys  Configures HTTP.sys (at load time)  Updates HTTP.sys whenever the configuration changes  Notifies WAS whenever a request enters the request queue  Does not manage the application pools and the worker processes.
  • 12.  Windows Process Activation Service (WPAS) (WAS)  Manage application pools and worker processes (for both the HTTP and non-HTTP protocols)  Can be used without W3SVC! (e.g. web service over TCP)  Loads configuration stored in applicationHost.config  Monitors configuration for any changes.  Informs listener adapters (such as W3SVC) if configuration changes.
  • 13.  Modules  New concept in IIS 7.0 – borrowed from ASP.NET.  Most of the web server functionality is built as Modules.  Two types  Native  Managed  Benefits  Plug-and-Play modules according to your needs.  Reduce attack surface and memory foot-print.  Customize a server to a specific role in your organization (application server, web server, ftp server, etc).  Write custom modules (C++ or any .NET language) to replace existing modules or to introduce new features.
  • 14.  Differences between Native and Managed Modules Native Modules Managed Modules C++ Any .NET language Difficult to develop Easy to develop Use this for migrating old ISAPI Use this for add new “features” or components over to IIS 7.0 enhancements to IIS 7.0 Unrestricted access to server Don’t have unrestricted access to resources server resources; .NET and ASP.NET security applies Need to be registered with IIS No need to register with IIS <globalModules> node Admin rights are needed to Admin rights are not needed to install/enable/un-install install/enable/un-install
  • 15.  IIS 7.0 Request Processing
  • 16.  Classic Mode  Integrated Mode  Benefits  Compatibility  App Pools  Enable ASP.NET services for all content  Enhanced ASP.NET API  Runtime Integration  Request Processing  ASP.NET Breaking Changes
  • 17.  Classic Mode  Just like IIS 6.0 Worker Process Isolation Mode.  Integration is based on aspnet_isapi.DLL.  ASP.NET content (.aspx, etc) are processed by ASP.NET runtime.  Non ASP.NET content (.htm, etc) are processed by IIS.  Major drawback  ASP.NET services are not available to non-ASP.NET content  When to use?  While porting an IIS 6.0 application that does not work in the Integrated Mode. (not recommended)
  • 18.  Integrated Mode  Integrates ASP.NET runtime with the core server.  One consolidated pipe-line.  Similar to ASP.NET pipe-line in IIS 6.0.  Adds new events  Modules subscribe to events  IIS core engine calls modules whenever the events occur.
  • 19.  Integrated Mode – Benefits  ASP.NET services are available to all of the content including.asp pages!  Fully extend IIS with ASP.NET  No need to write ISAPI  Now ASP.NET modules  Directly plug into the server pipe-line.  Execute in all stages of the request processing pipe-line.  Be executed in any order respective to the native modules! (Very important – for example, could replace the Basic Authentication provided by IIS)
  • 20.  Integrated Mode – Benefits  Unified Server Runtime  Eliminates the duplication of features in IIS and ASP.NET.  Tighter integration allows many features to be unified.  Unified configuration for IIS and ASP.NET modules and handlers  Custom Errors  Tracing  Output Caching
  • 21.  Integrated Mode – Compatibility  Existing and new applications can run side-by-side.  Existing applications in Classic mode.  New applications in Integrated mode.  What is an existing application is run in Integrated mode?  Might or might not work (Depends!)  Configuration changes b/c of the configuration unification.  Code changes b/c of the new runtime architecture and breaking changes.  IIS 7.0 is helpful! Shows detailed errors.
  • 22.
  • 23.  Integrated Mode – What to fix?  HTTP Modules  HTTP Error 500.22  Reason  Web.config contains <httpModules>.  Fix  Remove <httpModules>.  Add<system.webServer>/modules.  Or use appcmd to do it for you.  appcmd migration config quot;Default Web Site/App Namequot; -section:httpModules
  • 24.  Integrated Mode – What to fix?  HTTP Handlers  HTTP Error 500.23  Reason  Web.config contains <httpHandlers>.  Fix  Remove <httpHandlers>.  Add<system.webServer>/handlers.  Or use appcmd to do it for you.  appcmd migration config quot;Default Web Site/App Namequot; -section:httpHandlers
  • 25.  Integrated Mode – What to fix?  Impersonation  HTTP Error 500.24  Reason?  <identity impersonate=“true”/> could be problematic. Impersonated identity is unavailable until PostAuthenticateRequest stage.  Fix  Change the code written in BeginRequest and AuthenticateRequest events to not access the impersonated identity.  See if the code could be moved to PostAuthenticateRequest stage.
  • 26.  Integrated Mode – App Pools  Use IIS 6.0 Worker Process isolation mode.  Underlying mechanism for implementing Classic and Integrated modes in IIS 7.0!  An application pool specifies  Pool type (Classic vs Integrated)  .NET Framework Version
  • 27.
  • 28.  Integrated Mode – App Pools  Change ASP.NET mode for a pool  Why?  To create the appropriate pipe-line.  How  Use the Administration tool.  Use appcmd  Sets the app pool mode to Integrated  appcmd set apppool “app pool name” /managedPipelineMode:Integrated  Lists properties that can be set on an app pool  appcmd set apppool “app pool name” /?  Manually change the applicationHost.config file.
  • 29.  Integrated Mode – App Pools  Change app pool for an application  Why?  Allows you to run your application under a specific ASP.NET version or a different mode. (Don’t use aspnet_regiis to configure the ASP.NET version in IIS 7.0)  How?  Use the Administration tool.  Use appcmd  Sets the app pool mode to Integrated appcmd set apppool “app pool name” /managedPipelineMode:Integrated  Lists properties that can be set on an app pool appcmd set apppool “app pool name” /?  Manually change the applicationHost.config file.
  • 30.  Integrated Mode – Enable ASP.NET services for all of the content  Not enabled by default.  For backwards compatibility Run this module only for the managed requests
  • 31.  Integrated Mode – Enable ASP.NET services for all of the content  What are Pre-Conditions?  Answers to some questions.  IIS 7.0 configures itself based on the answers.  Pre-Conditions specify.  Process Bitness – bitness32, bitness64  Managed Extensibility Style – integratedMode, ISAPIMode  .NET Framework Version – runtimeVersionv1.1 , runtimeVersionv2.0  Managed Code Execution – managedHandler
  • 32.  Integrated Mode – Enable ASP.NET services for all of the content  How?  Change each and every module entry and remove the managedHandler pre-condition (tedious).
  • 33.  Integrated Mode – Enable ASP.NET services for all of the content  How?  Or set the runAllManagedModulesForAllRequests attribute for the <modules> section to true.
  • 34.  Integrated Mode – Enhanced ASP.NET APIs  APIs are backwards compatible – allows existing code to run in IIS.  New APIs have been added; couple of existing APIs have been changed.  HttpResponse.Headers  Allows changing the response headers generated by other applications.  HttpRequest.Headers  Now writeable! Allows modules to manipulate the incoming request headers (e.g. dynamically change the Accept-Language header).  HttpRequest.ServerVariables  Now writeable! Could be used for passing information to other application frameworks, such as PHP.
  • 35.  Breaking Changes  Passport Authentication  ASP.NET Error 500  Reason  Passport auth not supported on Vista and Windows Server 2008.  Applies to both Classic and Integrated modes.  Fix  Don’t use Passport authentication!
  • 36.  Breaking Changes  Query String > 2048  HTTP Error 404.15  Reason  This is the default limit.  Applies to both Classic and Integrated modes.  Fix  Change maxQueryString attribute.
  • 37.  Breaking Changes  HttpContext.Current.Request and HttpContext.Current.Response in Application_Start in global.asax  ASP.NET YSOD  Generates error if code tries to access these properties.  Reason  Application initialization tied to the arrival of 1st request – design flaw! couples the application initialization with the 1st request.  Fix  Write a module and move code in the BeginRequest stage for performing one time initialization.
  • 38.  Top changes in IIS 7.0  Simple configurable command line setup  Great compatibility  Most of the applications will work.  Classic mode allows for easy app migration.  IIS 6.0 meta-base compatibility layer for existing scripts  No more meta-base  Clear text schema  IIS settings are stored in applicationHost.config  Meta-base for SMTP/FTP/NNTP  Delegated configuration  Administrators can now delegate IIS settings to application owner.  Settings defined in web.config file in application directory.
  • 39.  Top changes in IIS 7.0  Appcmd and other new management options  Manage via the UI  Manage via the command line (replaces adsutil.vbs, iisapp.vbs, etc).  Command line management of sites, applications, vdir, app pool, etc.  Failed Request Tracing  Request Filtering
  • 40. IIS 7.0 Architecture and Integration with ASP.NET