Understanding IIS 7.0 Architecture

02月 27th, 2009

Understanding IIS 7.0 Architecture

>Overview of IIS 7.0 Architecture

@HTTP protocol stack(HTTP.sys):kernel mode protocol listener that listens for HTTP and HTTPS requests

@World Wide Web Service Publishing Service(W3SVC): HTTP listener adapter

@Windows Process Activation Service(WAS, also known as WPAS) : provides management of worker processes.

@Configuration store: a distributed XML-based file hierarchy that stores both IIS and ASP.NET settings.

@Worker process w3wp.exe: a long-running process that processes requests and generates responses.

 
 


 
 

Screen clipping taken: 2/16/2009, 3:24 PM

 
 


 
 

Screen clipping taken: 2/16/2009, 3:32 PM

 
 

>IIS 7.0 Core Components

>>HTTP.sys

@performs tasks

#intercepting and returning HTTP requests

#Preprocessing and security filtering of the incoming HTTP requests

#Queuing of HTTP requests for the application pools

#Caching of the outgoing HTTP responses

 
 


 
 

Screen clipping taken: 2/16/2009, 3:42 PM

 
 

@Routing table: used to determine which application pool responds to requests from what parts of the namespace.

 
 

>>World Wide Web Publishing Service

@Functionality is split between two services: W3SVC and WAS

 
 


 
 

Screen clipping taken: 2/16/2009, 3:54 PM

#W3SVC: acts as listener adapter for the HTTP listener, HTTP.sys.

 
 

>>Windows Process Activation Service

@WAS includes the following components

#Configuration manager, which reads application and application pool configuration from configuration store

#Process manager, which maps application pools to existing worker processes and is responsible for starting new instances of W3wp.exe to host new application pools in response to activation requests.

#Listener adapter interface, which defines how external listeners communicate activation requests they receive to WAS.

 
 

@configuration manager in WAS reads following information:

#Global configuration information

#Protocol configuration information

#Application pool configuration, such as the process account information

#Site configuration, such as bindings and applications

#Application configuration, such as the enabled protocols and the application pools to which the application belongs.

 
 

>>Configuration Store

@The distributed configuration hierarchy includes:

#global : applicationHost.config

#computer-wide

#.NET Framework configuration files machine.config

#root web.config configuration files located within the Web sites, applications, and directories.

 
 

@xcopy deployment of configuration alongside application code and content.

 
 

@distributed configuration store

 
 


 
 

Screen clipping taken: 2/16/2009, 4:53 PM

@administration stack

 
 


 
 

Screen clipping taken: 2/16/2009, 4:55 PM

 
 

>>Worker Process

@The role of a worker process is to process requests.

 
 


 
 

Screen clipping taken: 2/16/2009, 5:09 PM

 
 

>Request Processing in Application Pool

>>Classic Mode

@ASPNET ISAPI extension is responsible for processing the content types that are registered to it.

 
 


 
 

Screen clipping taken: 2/16/2009, 5:41 PM

@limitations:

#Services provided by ASP.NET modules are not available to non-AP.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

 
 

>>.NET Integrated Mode

 
 


 
 

Screen clipping taken: 2/16/2009, 5:50 PM

@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 : This stage authenticates the requesting user. The AuthenticateRequest event is raised.

#Authorize Request stage : At this stage, the AuthorizeRequest event is raised.

#Resolve Cache stage : At this stage, ResolveRequestCache event is raised. This stage checks to see if the response to the request can be retrieved from a cache.

#Map Handler stage : At this stage, the MapRequestHandler event is raised. This stage determines the handler for the request.

#Acquire State stage : At this stage, the AcquireRequestState event is raised. This stage retrieves the required state for the request.

#Pre-execute Handler 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.

#Execute Handler stage : At this stage, the ExecuteRequestHandler event is raised. The handler executes and generates the response.

#Release State stage : At this stage, the ReleaseRequestState event is raised. This stage releases the request state.

#Update Cache stage : This stage updates the cache. The UpdateRequestCache event is raised.

#Log Request stage : At this stage, the request is logged. The LogRequest event is raised.

#End Request stage : At this stage, the EndRequest event is raised, which signals that the request processing is about to complete.

 
 

>>How ASP.NET Integration Is Implemented

@Managed Engine

>>Module Scope

>>Module Ordering

 
 

>Non-HTTP Request Processing

 
 

Introducing IIS 7.0

02月 27th, 2009

Introducing IIS 7.0

>Foundation

@Runtime State and Control API:

Give administrators an in-depth view into the current state of the run-time objects, including current worker process and their currently executing requests, and also to enable administrators to use the same API to control those objects.

>>Windows Process Activation Service

 
 

>>Application Compatibility

@Active Directory Service Interfaces (ADSI)

 
 

>Basic Administration Tasks

@website=>a site, an application, a virtual directory, an application pool

#site

#application

#virtual directory

#application pool: a group of one or more applications that a worker process, or a set of worker process, serves.

 
 

@requests within application pools can be executed in one of two managed pipeline modes: integrated or classic

 
 

@binding=>binding protocol and binding information.

#binding protocol : defines the protocol over which communication occurs between the IIS server and the web client such as a browser.

#binding information : defines the information that is used to access the site.

 
 

>IIS 7.0 Features in Windows Server 2008 and Windows Vista

Subjects, Users, and Other Actors

02月 27th, 2009

@Object : the things you protect

@Subjects : the things you protect objects against

@authentication, authorization, auditing

@security principal : anything that can be assigned a security identifier and that can be given

permission to access something

 
 

>The Subject/Object/Action Tuple

 
 

>Types of Security Principals

>>Users : some distinct entity that logs on to a computer => local && domain

#local user : be defined in the local Security Accounts Manager (SAM) database on a computer

#domain account : be defined on the DC(s) for the domain and can be used on any computer

in the domain.

 
 

>>Computers

 
 


 
 

Screen clipping taken: 2/17/2009, 1:39 PM

>>Groups

 
 

>>Abstract Concepts

@INTERACTIVE

@NETWORK

@EVERYONE

@AUTHENTICATED USER

@USER

 
 

>>Services

 
 

>Security Identifiers

>>SID Components

 
 


 
 

Screen clipping taken: 2/17/2009, 2:06 PM

 
 

>>Service SIDs

@RID

Phase Summarization(20090209-20090215)

02月 14th, 2009

Weakness

  • IIS 7
  • Window Server 2008
  • SQL Server 2008
  • Visual Studio 2008
Todo
  • IIS Resource Kit(Part 1)
  • Window Server 2008 Security Resource Kit
  • T-SQL Recipes(SELECT and CAPTURE)
  • VS2008Unleashed(Part 1 and Part 2)

New Goal - ILiad 2nd Edition

02月 8th, 2009

 

人民币 5500

Planing 2009

01月 20th, 2009
  1. A job, let me live
  2. The successful completion of graduate design
  3. Enhancements in interpersonal relationships

T-SQL Basic and Element of Style

01月 19th, 2009

Statement

  • Querying
  • Data Manipulation Language
  • Data Definition Language
  • Data Control Language
  • Transactional Control Language
Database
  • resource
  • master, do not access master directly but through catalog view
  • model
  • msdb
  • tempdb
Transaction Log
Schema
Tables
  • Foreign Key contrains
  • Check contrains
  • Triggers
Views
  • They can be used to hide the compelxity of queries
  • They can be used as a security device to limit the rows and columns of a table that a user can query
  • Indexed View:SQL Server persists to the database like a table
Indexes
  • Clustered Index
  • Nonclustered Index
  • XML Index
  • Spatial Index
  • Full-Text Index
Stored Procedure
User-Defined Functions
SQL CLR Assemblies
Element of Style
WhiteSpace
Name Convention
  • Use alphabetic characters for the first character of your identifiers.The obvious exceptions are SQL variable names that starts with at sign(@), temporary table and procedure that starts with number sign(#), and global temporary table and procedure that starts with double a number sign(##).
  • Many built-in functions and System variables have names that begin with a double at sign(@@).
  • Restrict the remaining characters in your identifiers to alphabetic characters, numeric digits, and underscore character.
  • Avoid embedded spaces, punctuation marks, and other special characters in your identifiers
  • Avoid using SQL Server 2008 reserved keywords as identifiers
  • Limit the length of your identifiers
One Entry, One Exit

Defensive Coding

SQL-92 Syntax Outer Joins

The Select * Statement

Variable Initialization

阶段总结-2009-1-15

01月 16th, 2009

缺陷:

1.英语

2.沟通

3.软件测试

.Net Core Programming

01月 14th, 2009

1.System.Environment Class

   ExitCode,MachineName,UserName…

2.System.Console Class

   *Beep(),BufferWidth,BufferHeight,Clear()

   *Format {0:C}(CcDdEeFfGgNnXx)

   *ICustomFormatter

3 System Data Type and Shorthand Notation

   Value Type and Ref Type

4 System.DateTime and TimeSpan

5 Type Convertion

   unchecked,checked

   narrowing and widening 

Object lifetime in C#

01月 13th, 2009

1.Application Root

   a root is a storage location containing a reference to a object on the heap.

2.Object Generations

   the longer an object has existed on the heap, the more likely it is to stay here

   Generation 0:Identifies a newly allocated object that has never been marked for collection

   Generation 1:Identifies an object that has survived a garbage collection

   Generation 2:Identifies an object that has survived more than one sweep of garbage collector

3.The System.GC Type

   GC.Collect()

   GC.WaitPendingFinalizers()

4.Building Finalizable Objects

  ~ClassName()/When using raw OS resource, DB Connection, Platform Invocation Service,COM interoperability

   Freachable table:we need two generation for finalization

5.Building Disposable Objects

   using(object x = new object(),object y = new object){}

6.Building Finalizable and Disposable Objects

   a formalized disposal pattern

   private bool disposed = false;

   void dispose()

   {

      CleanUp(true);

      GC.SuppressFinalize(this);

   }

   ~Class()

   {

      CleanUp(false);

   }

   private void CleanUp(bool disposing)

   {

      if(!this.disposed)

      {

           if(disposing)

           {

               //release managed resource

           }

           //release unmanaged resource

           this.disposed = true;

      }

   }

       }