Internet Information Services 7.0 for ASP.Net Developers

Download Report

Transcript Internet Information Services 7.0 for ASP.Net Developers

Internet Information Services 7.0
for ASP.Net Developers
Andrew Westgarth
Tuesday 9th December 2008
Scottish Developers - Glasgow
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Monkey Business
ASP.Net Code Monkey
VBUG North East Regional Coordinator
Live in Sunderland!
Huge Sunderland A.F.C. Supporter
Very Interested in Wartime exploits of 617
Squadron – The Dam Busters
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Agenda
•
•
•
•
•
•
•
•
•
•
•
•
Overview and Availability in Vista SKUs
Architecture
Administration
Componentization
Extensibility Model
Troubleshooting and Diagnostics
Configuration
Features
Unified Platform for Web Services and WCF
Conclusions
Questions
Resources
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Overview
• Most significant release of IIS since IIS 1.0
• Available on Windows Vista and Windows
Server 2008
• First time development and server platform
versions of IIS aligned
• ASP.Net Integrated Pipeline
– New extensibility model
– Expanded Productivity Support
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Availability In Vista SKUs
• Not Available in Vista Home Basic
• Parts Available in Vista Home Premium
– No FTP Server, Advanced Web Authentication and
Authorization, and Remote Administration
– Simultaneous Request Limit = 3
• All elements of IIS7 found in Windows Server
2008 are available in the Vista Pro
SKUs(Business, Enterprise and Ultimate) with
the exception of Remote Administration
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
IIS6 Architecture
Authentication
NTLM
Basic
Anon
CGI
aspnet_isapi.dll
Determine
Handler
Authentication
Forms
Windows
Static
File
...
ASP.Net
ASPX
ISAPI
PHP
Send Response
Log
Compress
Map
Handler
Trace
...
...
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
IIS6 Request Handling
Handlers
CGI
Static File
w3wp.exe
ISAPI EXT
Aspnet_isapi.dll
IHttpModule Events
url map
Begin req
Auth‘c req
Auth’z req
Resolve cache
Handler map
Handler exec
Determine handler
logging
Custom errors
compression
authentication
ISAPI Filter Notification
url map
Auth c’req
log
Pre-Proc Headers
End Net Session
End req
Update req cache
Rel req state
IHttpHandlers
Trace.axd
Page Handler
http.sys
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
HTTP Request
IIS7 Architecture
Basic
Authentication
Forms
Anon
Windows
...
ASPX
Execute Handler
Static File
...
Trace
...
Send Response
Compression
Log
HTTP Response
Andrew Westgarth http://www.andrewwestgarth.co.uk/Blog [email protected]
IIS7 Request Handling
Native Handler
static file
Native Module
WAS
Native Modules
Native Modules
Native Modules
Basic Auth
Digest Auth
Windows Auth
IHttpHandler
isapi ext
*.aspx
end
log
update cache
release state
execute handler
pre-execute handler
acquire state
map handler
resolve cache
authorize
authenticate
begin
trace.axd
IHttp Module
Managed Modules
Managed Modules
Managed Modules
Url Authorization
Role Manager
Forms
Authentication
http.sys
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Administration
• New Administration UI
• New Command Line Utility appcmd.exe
• New Managed DLL –
Microsoft.Web.Administration
• Can be Delegated
• Server can be managed Remotely
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Delegated Administration
• Server Administration can be delegated via
configuration
– Allows Administrators to enable others to control
aspects of configuration
• Remote Administration of IIS in Windows
Server 2008
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Demo – IIS7 Administration
• Administration UI and AppCmd
• Review of Microsoft.Web.Administration
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Componentization
• IIS7 Now Fully Modular
• Can have very small server footprint
• Customise to only install/enable features you
want to have running
• Therefore only patch what you need/use
Andrew Westgarth http://www.andrewwestgarth.co.uk/Blog [email protected]
Components of IIS7
Health and
Diagnostics
FTP Publishing
BasicAuthMode
Application
Development
DigestAuthMode
NetFxExtensibility
HttpLoggingModule
FTP Management
WindowsAuthMode
ISAPIModule
CustomLoggingModule
CertificateAuthMode
ISAPIFilterModule
RequestMonitorModule
Performance
AnonymousAuthMode
CGIModule
HttpTracingModule
Static Compression
IPSecurityModule
ServerSideIncludeModule
ODBCLogging
Dynamic Compression
UrlAuthorizationModule
ASP
LoggingLibraries
RequestFilteringModule
ASP.Net
Security
FTP Server
Management
ManagementConsole
ManagementScripting
Common HTTP Web Server Components
StaticFileModule
DefaultDocumentModule
HttpRedirect
DirectoryListingModule
CustomErrorModule
Windows Process Activation Service
ProcessModel
NetFxEnvironment
ManagementService
ConfigurationAPI
Metabase
WMICompatability
LegacyScripts
LegacySnap-In
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Configuration
• No more Metabase!!!!
• Compatability – old metabase pushed to new
config – same property names
• Central File – ApplicationHost.config
– Strongly Typed Schema
– Use same methodology as ASP.Net .config files
• Distributed Configuration
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Demo - Configuration
• Let’s take a look at the new configuration
system.
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Extensibility Model
• IIS6 – ISAPI Filter and Extensions
• IIS7 – Brand New Win32 Native Interface
– All IIS Modules written using this interface
– IIS Team uses this API just like you WILL!
– Full ASP.Net 2.0 Support
– IHttpModule available supported today!
– ASP.Net 2.0 Handlers run same as today
– IIS Manager (UI)
– Extend using .Net 2.0
– Diagnostics
– Add own events directly into pipeline (System.Diagnostics)
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
ASP.Net HttpHandlers and HttpModules
• HttpHandler
– Similar to ISAPI extensions
– Can be called via url
– Act as target for incoming requests
• HttpModules
– Plug into the ASP.Net request processing pipeline
– Registered for certain events
– As the event occurs the ASP.Net invokes the
module so it can handle the request
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Demo Extensibility
• Build Image Copyright Handler
• Build Module and Integrate with IIS7 Admin
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Troubleshooting and Diagnostics
• Real Time State Information Available
– Current Processes Running
– Application Pools Process ID
– Currently executing requests
– AppDomains loaded
• Real-time starting and stopping of sites
• Failed Request Tracing
• Extensive Custom Errors
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Failed Request Tracing
•
•
•
•
Traces all requests through Pipeline
Automatically Enabled on IIS7
Easily identify failing, stuck requests
Identifies time take in each module, helping
analyzing long running requests
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Custom Errors
• Much more detailed
– Language specific (Accept-Encoding)
– Time
– URL
– Current Module
– Response Status, Sub-Status
– More Information – Detailed steps to fix problem
where available
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Demo Troubleshooting
• Custom Error Pages
• Failed Request Tracing
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Unified Platform for Web Services and
WCF
• Host WCF Services using Windows Activation
Service (WAS)
• Supports Non-HTTP Protocols such as
– Named Pipes
– TCP
– MSMQ
• Provides features for idle-time management,
health monitoring, process recycling
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
WAS Processing of Service Requests
Worker Process (w3wp.exe)
App Domain
TcpProcess
ProtocolHandler
HttpHandler
HttpModule
Windows
Activation
Service
(WAS)
MSMQProcess
ProtocolHandler
NamedPipeProces
sProtocolHandler
W3svc
HTTP
Listener
Adapter
Named Pipe
Inpass
Listener
Adapter
TCPItcpas
Listener
Adapter
MSMQ
Imsmqas
Listener
Adapter
Http.sys
Net.pipe
Net.tcp
net.msmq
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
What’s Next?
• IIS Extensions
–
–
–
–
–
Admin Pack; DB Manager; Remote Management
Powershell Provider
URL Rewriter; Application Request Routing
FTP; WebDav
Bandwidth Throttling; Web Playlists
• Web Platform Installer – W2K3;XP;Vista;W2K8
• Web Deployment Tool
– Synchronise Web Applications; Package; Migrate; Deploy
• W2K8 R2 – ASP.Net in Server CORE
• Best Practices Analzer
Andrew Westgarth http://www.andrewwestgarth.co.uk/Blog [email protected]
Conclusions
•
•
•
•
•
•
Major Release – Most Significant since 1.0
Fully Customisable – Managed and Native
New Pipeline
ASP.Net Fully integrated
First time desktop and server versions aligned
Go and have a Look
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Questions
• Now
• Via my blog –
http://www.andrewwestgarth.co.uk/Blog
• [email protected]
• Twitter – http://twitter.com/apwestgarth
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]
Resources
•IIS Resources – http://www.iis-resources.com
•Help with F5 debugging on Vista –
http://mvolo.com/blogs/serverside/archive/2006/12/28/Fix-problemswith-Visual-Studio-F5-debugging-of-ASP.Net-applications-on-IIS7Vista.aspx
•MSDN Magazine Article –
http://msdn.microsoft.com/msdnmag/issues/07/03/iis7/default.aspx
Andrew Westgarth - http://www.andrewwestgarth.co.uk/Blog - [email protected]