IIS 7.0

IIS 7.0

微軟下載地址:http://download.microsoft.com/download/1/0/d/10da04bb-4e82-485a-abb3-94feff40a7b3/NETShow56_300.EXE 

IIS 7.0是我的團隊今年稍後將推出的最讓我激動不已的產品之一。它是自IIS 1.0之後我們所做過的最重大的web服務器發佈,它將爲管理人員和開發人員引入不計其數的改進。

IIS開發團隊的Mike Volodarsky爲MSDN雜誌的2007年3月期撰寫了一篇精彩的文章 (英文版),總結了IIS 7.0的一些主要改進。我強烈建議你去這裏 (英文版)閱讀一下他的精彩文章,以對這些改進有個簡短了解。

IIS 7.0是包括在Windows Vista客戶機上的,該操作系統的家庭版本也帶有IIS 7.0(而不象IIS 5.1,只有在XP Professional上纔有)。服務器的IIS 7.0版本將在今年稍後隨Windows Longhorn服務器發佈,將添加一堆額外的部署特性,包括更加豐富的主機支持,安全的FTP支持,以及內置的web farm部署支持等。

Web farm支持將是特別地酷,它將允許你在一個包含了運行一個服務器所需的所有編碼,配置,內容和密鑰的文件共享上部署你的web應用。然後你可以添加任意數目的無狀態,無配置的web服務器到一個web farm上,只需將它們指向那個文件共享,來動態裝載它們的配置設置(包括綁定,虛擬目錄,應用池設置等等)和應用內容即可。這使得在多個機器上擴縮一個應用簡直是小菜一碟,可避免使用複製方法來做配置和應用部署(只要把文件拷貝到文件共享上,web farm裏的所有機器就會馬上裝載變動過的文件)。

即將推出Windows Longhorn服務器的Beta3版本將會支持go-live許可,所以你不久就能利用這個功能。我們已經在用IIS 7.0集羣運行 www.Microsoft.com 了,所以你不會寂寞的!(【譯註:在本文的中文版發表之前,Windows Longhorn服務器的Beta3版本已經發布】)

ASP.NET和IIS 7.0之集成

在早期的IIS版本中,開發人員需要編寫ISAPI擴展/過濾器來擴展服務器的功能。除了寫起來非常痛苦外,ISAPI在如何接入服務器以及允許開發人員定製方面也是非常有限。譬如,你無法在ISAPI擴展中實現URL重寫代碼(注:ASP.NET是以ISAPI擴展的方式實現的)。假如你把運行時間長的代碼編寫成ISAPI過濾器的話,結果是你將佔用web服務器的I/O線程(這就是我們不讓託管代碼在請求的過濾器執行階段運行的原因)。

我們在IIS7中對核心IIS處理引擎做的一個重大的架構級變動是通過一個新的模塊化的請求管道架構來促成極其豐富的擴展性。你現在可以通過與web服務器註冊一個HTTP擴展性模塊(HTTP Extensibility Module),在任意一個HTTP請求的生命週期的任何地方編寫代碼。這些擴展性模塊可以使用native的C++代碼或.NET託管代碼來編寫(你可以使用現有的ASP.NET System.Web.IHttpModule接口來實現)。

所有“內置”的IIS7功能(認證,授權,靜態文件供應,目錄清單支持,經典的ASP,記錄日誌等),現在都是使用這個公開的模塊化的管道API來實現的。這意味着你可以除去這些IIS7“內置”功能的任意一個,而以你自己的實現來替換/擴展這些功能。

IIS 7.0上的ASP.NET本身也從以ISAPI的實現形式變成直接接入IIS7管道的模塊:

這帶來諸多好處:

1) 你現在可以對服務器的所有請求(譬如, .htm,.php,.jsp文件)使用ASP.NET表單認證,成員/角色,以及任何其他特性。

2) 你現在可以輕鬆地重寫任何web請求的URL或者以種種有趣的方式對請求做改動。

3) 你可以使用VB或C#替換或擴展任何現有的IIS特性(譬如,你可以除去內置的目錄清單模塊,接入你自己的模塊)。

這確實給.NET開發人員帶來了無窮多的擴展性機會。

IIS 7.0 下載中心

爲幫助開發人員共享他們編寫的擴展性模塊和其他add-in,IIS開發團隊最近在www.iis.net上發起了一個 “下載中心”,這允許開發人員瀏覽/下載以及上傳和共享IIS的模塊擴展。你可以在這裏查看一下。

注意,除了讓你編寫託管的HTTP模塊的擴展性功能外,IIS7現在也允許你編寫託管的管理工具的UI擴展(管理工具本身是使用 Windows Forms編寫的),以及使用.NET的System.Configuration 命名空間來管理IIS7配置系統。

可爲ASP.NET開發人員所用的酷場景

除了IIS 7.0提供的既酷又新的擴展性選項外,還有ASP.NET開發人員將會非常欣賞的成堆的大大小小的改進。我將在接下來的幾個星期/月份裏在博客裏討論一系列的改進,指出你能利用的一些非常酷的東西。

我也強烈建議你訂閱IIS 7開發團隊在這裏的博客feed。

希望本文對你有所幫助,

英文原文:

IIS 7.0

IIS 7.0 is one of the products that my team is shipping later this year that I'm most excited about.  It is the most significant release of our web-server that we've done since IIS 1.0, and introduces a huge number of improvements for both administrators and developers.

Mike Volodarsky from the IIS team wrote a great article for the March 2007 MSDN Magazine that summarizes some of the key IIS 7.0 improvements.  I highly recommend reading his excellent article here for a quick summary of some of them.

IIS 7.0 is included within the Windows Vista client release, and is now available with the home editions of the operating system (unlike IIS 5.1 which was only available with XP Professional).  IIS 7.0 for server will ship later this year with Windows Longhorn Server, and will add a bunch of additional deployment features - including much richer hosting support, secure FTP support, and built-in web farm deployment support. 

The web farm support in particular is really cool, and will allow you to deploy your web applications on a file-share that contains all of the code, configuration, content, and encryption keys needed to run a server.  You can then add any number of stateless and configuration-less web-servers into a web farm and just point them at the file-server to dynamically load their configuration settings (including bindings, virtual directories, app pool settings, etc) and application content.  This makes it trivial to scale out applications across machines, and avoid having to use replication schemes for configuration and application deployment (just copy over the files on the file-share and all of the machines in the web farm will immediately pick up the changes). 

The upcoming Beta3 release of Windows Longhorn Server will support a go-live license, so you'll be able to take advantage of this soon.  We are already running www.Microsoft.com on IIS 7.0 clusters (so you'll be in good company!).

ASP.NET and IIS 7.0 Integration

In previous versions of IIS, developers had to write ISAPI extensions/filters to extend the server.  In addition to being a royal pain to write, ISAPIs were also limited in how they plugged into the server and in what they allowed developers to customize.  For example, you can't implement URL Rewriting code within an ISAPI Extension (note: ASP.NET is implemented as an ISAPI extension).  And you end up tying up the I/O threads of the web-server if you write long-running code as an ISAPI Filter (which is why we didn't enable managed code to run in the filter execution phase of a request). 

One of the major architectural changes we made to the core IIS processing engine with IIS7 was to enable much, much richer extensibility via a new modular request pipeline architecture.  You can now write code anywhere within the lifetime of any HTTP request by registering an HTTP Extensibility Module with the web-server.  These extensibility modules can be written using either native C++ code or .NET managed code (you can use the existing ASP.NET System.Web.IHttpModule interface to implement this). 

All "built-in" IIS7 functionality (authentication, authorization, static file serving, directory listing support, classic ASP, logging, etc) is now implemented using this public modular pipeline API.  This means you can optionally remove any of these IIS7 "built-in" features and replace/extend them with your own implementation.

ASP.NET on IIS 7.0 has itself been changed from being implemented as an ISAPI to instead plug in directly as modules within the IIS7 pipeline:

Among the many benefits this brings:

1) You can now use ASP.NET Forms Authentication, Membership/Roles, and any other feature for all requests to the server (for example: .htm, .php, and .jsp files)

2) You can now easily re-write the URL of any web request and/or modify the request in interesting ways

3) You can replace or extend any existing IIS feature using VB or C# (for example: you could remove the built-in directory listing module and plug-in your own).

This really brings a tremendous number of extensibility opportunities to .NET developers.

IIS 7.0 Download Center

To help enable developers share the extensibility modules and other add-ins they write, the IIS team recently launched the "Download Center" on www.iis.net.  This enables developers to browse/download as well as upload and share module extensions for IIS.  You can check it out here.

Note that in addition to having a managed extensibility story for Http Modules, IIS7 also now allows you to write managed admin tool UI extensions (the admin tool itself was built using Windows Forms), as well as use the .NET System.Configuration namespace to manage the IIS7 configuration system. 

Cool Scenarios for ASP.NET Developers

In addition to the cool new extensibility options that IIS 7.0 provides, there are a ton of improvements (both big and small) that ASP.NET developers will really appreciate.  I'll be blogging a series of them over the next few weeks/months and point out some really cool things that you'll be able to take advantage of. 

I also highly recommend subscribing to the IIS 7 team's blog feed here

 
發佈了52 篇原創文章 · 獲贊 0 · 訪問量 10萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章