IIS 7: The Administrator's Guide: Alexis Eller Program Manager Microsoft Corporation
IIS 7: The Administrator's Guide: Alexis Eller Program Manager Microsoft Corporation
CGI
Determine Handler
ASP.NET PHP
Send Response
Log Compress
Server functionality is split into ~ 40 modules... Modules plug into a generic request pipeline
ISAPI
Installing IIS7
CGI
Determine Handler
ASPX
Send Response
Log Compress
Map Handler
Trace
Two Modes
Classic (runs as ISAPI) Integrated
UpdateCache SendResponse
/ handlers Forms Windows plug directly into pipeline Process all requests ASPX Full runtime fidelity Map
Handler
Trace
Compress
Log
File System:
Client Side Caching (CSC)
provides a local disk cache
Configuration Layout
Inheritance
IIS IIS + ASP.NET + .NET Framework
root web.config
Configuration Delegation
Delegation is:
Configuration locking, overrideMode ACLs on configuration files
By default
All IIS sections locked except:
Default Document Directory Browsing HTTP Header HTTP Redirects
IISADMIN
ABOMapper
Cant read/write ASP.NET properties Cant read/write web.config files Cant access new runtime data, e.g. worker processes, executing requests
applicationHost.config
Management Tools
GUI Command Line Script Managed Code IIS Manager appcmd WMI (root\WebAdministration) Microsoft.Web.Administration
IIS Manager
Educate end users who publish their application and use IIS Manager configure it Scenario:
User publishes application User changes apps web.config using IIS Manager User copies updated web.config to his local version of the application Several days later, user re-publishes application ** modifications make to the apps web.config using IIS Manager have just been blown away**
C:\> appcmd list requests REQUEST "fb0000008000000e" (url:GET /wait.aspx?time=10000,time:4276 msec,client:localhost) C:\> appcmd list requests /apppool.name:DefaultAppPool C:\> appcmd list requests /wp.name:3567 C:\> appcmd list requests /site.id:1
appcmd
' Create binding for new site Set oBinding = oIIS.Get("ServerBinding").SpawnInstance_ oBinding.IP = "" oBinding.Port = "80" oBinding.Hostname = "www.site.com"
' Create site and extract site name from return value Set oService = oIIS.Get("IIsWebService.Name='W3SVC'")
strSiteName = oService.CreateNewSite("NewSite", array(oBinding), "C:\inetpub\wwwroot") Set objPath = CreateObject("WbemScripting.SWbemObjectPath") objPath.Path = strSiteName strSitePath = objPath.Keys.Item("") Set oSite = oIIS.Get("IIsWebServer.Name='" & strSitePath & "'") oSite.Start ' Create the vdir for our application Set oVDirSetting = oIIS.Get("IIsWebVirtualDirSetting").SpawnInstance_ oVDirSetting.Name = strSitePath & "/ROOT/bar" oVDirSetting.Path = "C:\inetpub\bar" oVDirSetting.Put_ ' Make the VDir an application Set oVDir = oIIS.Get("IIsWebVirtualDir.Name='" & strSitePath & "/ROOT/bar'") oVDir.AppCreate2 1
Create Application
Coding: Microsoft.Web.Administration
ServerManager iisManager = new ServerManager();
foreach(WorkerProcess w3wp in iisManager.WorkerProcesses) { Console.WriteLine("W3WP ({0})", w3wp.ProcessId); foreach(Request request in w3wp.GetRequests(0)) { Console.WriteLine("{0} - {1},{2},{3}", request.Url, request.ClientIPAddr, request.TimeElapsed, request.TimeInState); } }
Summary
Deploy
~ 40 modules, install only what you need Migrate to ASP.NET Integrated Mode Easier centralization/replication
Manage
Manage IIS and ASP.NET through the same tools Use ABO Mapper compatibility (not installed by default) Determine configuration lockdown policy
Troubleshoot
Use: Detailed Errors, Failed Request Tracing, Currently Executing requests
Tomorrow
8:30 9:45 IIS 7: Under the Hood for Web Request Tracing
Wednesday
8:30 9:45 Chalktalk: Extending the IIS Manager Tool in IIS 7 2:00 3:15 Chalktalk: IIS 6.0 Security: Setting the Record Straight 4:45 5:00 Chalktalk: IIS and Microsoft.com Operations: Migrating IIS 6.0 to 64 bit 5:30 6:45 Chalktalk: IIS 7 Q&A
2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Additional Information
Installation Options
Lots of components Static server by default [client] Use Windows Features
Replaces sysocmgr
File format is completely different [client] Pick components, cannot set configuration
ASP.NET: Migration
Application Pools
ASP.NET Integrated mode by default Configure to load a specific version of the .NET Framework
Integrated Mode
Different server environment for some pipeline notifications
e.g. request is not authenticated for BeginRequest
Validation warns on httpHandlers, httpModules, or identity config Remove managedHandler precondition on an ASP.NET module to have it execute for all content
ISAPI Mode
Cant configure HTTP handlers and modules from the UI
Replicating applicationHost.config
Will cause all application pools to recycle:
changes to default settings for all application pools changes to the <globalModules> list
Gotcha's:
Machine specific data, like IP addresses or drive letters Servers must have same set of modules installed (reference to non-existent module in <globalModules> causes 503's)
Configuration Delegation
Two kinds of configuration locking:
overrideMode (similar to "allowOverride") granular locking, e.g. lockItem, lockElements
By default
All IIS sections locked (overrideMode=Deny) except:
Default Document, Directory Browsing, HTTP Header, HTTP Redirects, Validation
Configuration Schema
Use the schema file to see all config settings:
%windir%\system32\inetsrv\config\schema\IIS_schema.xml
Schema describes:
property types default values validation encrypted by default?
C:\> appcmd list config /section:directoryBrowse /text:* CONFIG CONFIG.SECTION: system.webServer/directoryBrowse path: MACHINE/WEBROOT/APPHOST overrideMode: Inherit [system.webServer/directoryBrowse] enabled:"true" showFlags:"Extension, Size, Time, Date"
Coding: Microsoft.Web.Administration
First managed code API for administering IIS
Same objects and functionality as WMI, appcmd
Microsoft.Web.Administration:
Weakly typed IIS, ASP.NET, and .NET Framework config Strongly typed IIS objects like Sites and Application Pools