Windows as a Web Platform: Introducing IIS7 Eric Nelson Application Architect http://blogs.msdn.com/ericnel “ISV Stuff” Two great things happened to Microsoft in Feb 1996 1. Eric joined Microsoft 2. IIS 1.0 was released and Microsoft “woke up” to the power of the Internet Client/Server “Smart Terminals” GUIs for Green Screens Fat-Client + Database LAN Communication Microsoft IIS 1.0, 2.0, 3.0 IIS 4.0 – March 2007, then “downed tools”… Web Client and Smart Client Internet, WAN and LAN Communication Microsoft IIS5.0 (pretty much IIS4.0) Security Here goes... SOA Web 2.0 SaaS S+S ESB ISB Microsoft IIS 6.0 in Windows Server 2003 IIS 7.0 in Vista and Windows Server 2008 Proven Scale MySpace - 23 Billion Page Views/Month Microsoft.com - 10k Req/sec & 300K Connections Match.com 30 million pages view daily Proven Trust 54% of Fortune 1000 use IIS (port80software.com) Proven Security No critical IIS 6 hotfixes since RTM* Note to Qcon – could we have run this conference one month earlier? A solid foundation to build on IIS 7 was released in 2006 with Windows Vista IIS 7 was released in Feb 2008 with Windows Server 2008 Microsoft.com Switched to Beta 3 of Windows Server 2008 on June 12 2007 Great Compatibility 99%+ ASP and ASP.NET worked One application encountered breaking change out of 260 And loved AppCmd, new UI, death of metabase, metabase shared config, failed request tracing etc. http://blogs.technet.com/mscom/archive/2007/09/07/the-tasty-morsels-found-in-dogfood-mscom-ops-tophttp://blogs.technet.com/mscom/archive/2007/09/07/the 10-changes-in-iis7-0.aspx More than a Web server, Internet Information Services 7.0 provides an accessible, extensible platform for developing and reliably hosting Web applications and services IIS 7.0 Enhancements Modular Architecture Extensible Design Integrated with .NET Manageable Built in Request Tracing Create Streamlined Servers Reduced Attack Surface Rapid Application Deployment Extend/Modify IIS Features Fast Diagnostics IIS 7.0 Enhancements Modular Architecture Extensible Design Integrated with .NET Manageable Built in Request Tracing IIS 6 IIS 7 Benefits Architecture Monolithic Modular Customize, Extend, Streamline Setup Most Features Minimal installed installation for (many disabled) designated role Increased Security Extend Features ISAPI filters and Add modules ISAPI and handlers in native or extensions managed code Easier to develop application and administration features Customize UI Possible, but not common. Much easier for developers to provide new admin features Extensible, modular, based on .NET Authentication NTLM Basic Anon … CGI Determine Handler Static File Monolithic implementation Install all or nothing… nothing… Extend server functionality only through ISAPI ISAPI… … ASP.NET ISAPI PHP … Send Response Log Compress Authentication NTLM Basic Server functionality is split into ~ 40 modules modules... ... Anon Authorization … ResolveCacheCGI … Determine Static File Handler ExecuteHandler ISAPI … … UpdateCache Send Response SendResponse Log Compress Modules plug into a generic request pipeline… Modules extend server functionality through a public module API. Completely redesigned IIS Manager Task-oriented Allows IIS & and ASP.NET configuration Extensible Add management features Add application configuration View health and diagnostics within the UI Remote administration over https Manage 1 or 1000’s of sites IIS 7.0 Enhancements Modular Architecture Extensible Design Integrated with .NET Manageable Built in Request Tracing Authentication NTLM Basic Anon … Determine Handler CGI aspnet_isapi.dll Static File Authentication ISAPI Windows … ASPX … Send Response Log Forms Compress Map Handler Trace … … Basic Anon Authentication Authorization ResolveCache … ExecuteHandler … Classic (IIS 6) Integrated Mode .NET modules / handlers aspnet_isapi.dll Static File plug directly into pipeline Authentication Forms ISAPI Process Windows all requests … Full runtime fidelity ASPX UpdateCache SendResponse Two App Pool Modes Map Handler Compress Log Trace … … IIS Manager, Modules, .NET Integration IIS 7.0 Enhancements Modular Architecture Extensible Design Integrated with .NET Manageable Built in Request Tracing Metabase to Applicationhost.config file Easier to use Human readable XML Config can be copied to other servers You now have choices about how to manage IIS configuration Centralized Configuration Delegated Administration Shared Configuration Contoso.com \ Orders .NET Framework Machine.config NET global settings Site Root Web.config Global web.config ASP.net global settings <system.web> .NET settings .. .. IIS 7 Applicationhost.config Global settings and location tags .. <system.webServer> IIS7 Delegated settings .. Remote Administration Use IIS Manager from XP, Vista, Windows Server 2003/2008 Auto-deployment deployment and hide Delegated Administration Delegate control to site owners without elevated priviledges Extremely granular: Require Windows Authentication - let site owner control turn on/off Basic Shared Configuration All administration tools are redirected to a common UNC path AppCmd simple cmd-line syntax powerful mgmt objects inline help & multiple outputs C: C:\ \> appcmd list sites SITE "Default Web Site" (id:1,bindings:HTTP/*:80:,state:Started) SITE "Site1" (id:2,bindings:http/*:81:,state:Started) SITE "Site2" (id:3,bindings:http/*:82:,state:Stopped) (id:3,bindings:http/*:82:,state:Stopped) C:\> appcmd list requests REQUEST "fb0000008000000e" (url:GET /wait.aspx?time=10000,time:4276 wait.aspx?time=10000,time:4276 msec,client:localhost msec,client:localhost) ) C: C:\ \> appcmd list requests /apppool.name:DefaultAppPool C: C:\ \> appcmd list requests /wp.name:3567 C: C:\ \> appcmd list requests /site.id:1 Filter results by application pool, worker process, or site IIS 7.0 Enhancements Modular Architecture Extensible Design Integrated with .NET Manageable Built in Request Tracing View Detailed Errors in the Browser Access Runtime State Info in Real-Time Real Ex. See all currently executing requests Rapidly Troubleshoot Faulty Applications Rules define ‘failures’ that triggers report of pipeline events Define by http result code and/or time taken Config files, Delegation, AppCmd, Request Tracing Most extensible yet Modular, IIS Manager, .NET Most .NET friendly yet Integrated pipeline, shared web.config Most manageable yet Simplified deployment, server farms, administration Xcopy of config files, shared config, config appcmd Easier to troubleshoot Most secure yet Reduced attack surface, .NET Integration for Auth, Application Pool Isolation URLAuthorization and Request Filtering Most PHP Friendly yet… PHP MySQL Apache Linux 4 OR? 1 On October 30th, 2006, Microsoft and Zend announced a multi-year multi collaboration to improve the performance and stability of PHP on Windows Benefits -Huge Huge ecosystem of apps potentially being available on Windows -Making Making it easier for PHP developers to take advantage of the Microsoft Web platform CGI ISAPI Invokes a process for each request. Loaded as extension in process. Advantages Easy to Configure Stable Execution Advantages Better Performance Disadvantages Slow due to I/O Overhead of Disadvantages Many PHP Applications are FastCGI Extension to CGI allowing reuse of a process. Advantages Easy to Configure Faster than CGI More stable than PHP on ISAPI FastCGI in IIS6 FastCGI in IIS7 Available from the Download Center Available in Windows Server 2008 and Vista SP1 Delivered as a separate download from Windows Server 2003. Delivered as part of IIS7. Users must install the CGI feature in IIS to enable FastCGI. ISAPI extension Native IIS7 module Resources, forums, and reference material available on IIS.NET Product help documentation, as well as resources on IIS.NET. Configured via fcgiext.ini Configured via the new XMLbased configuration system in IIS7. Fully supported upported by Microsoft Supports PHP and other FastCGI frameworks 2 New Server Core installation option of Windows Server 2008 allows for installation of server roles with only the necessary components and subsystems Benefits -A minimal footprint, low-maintenance maintenance web server that can host PHP applications -Providing Providing an option that will resonate with PHP hosters and developers http://www.microsoft.com/windowsserver2008/servercore.mspx 3 On October 9th, 2007, the first CTP of the SQL Server Driver for PHP was released. Enables reliable, scalable integration with SQL Server for PHP applications deployed on the Windows platform. Benefits -One One answer to the question “What do we do with MySQL when we become really successful?” -SQL Server 2005 and 2008 rocks -SQL SQL Server 2005 Express is free option http://www.microsoft.com/sql/technologies/php/default.mspx 4 The next version of Expression Web will be the first Microsoft tool to offer PHP support. Benefits - An alternative great tool for Designers using PHP http://IIS.NET Walkthroughs, examples, and code samples, online labs Webcasts http://www.microsoft.com/emea/spotlight/result_search.aspx?produ ct=12 (August 24th) http://iis.net/PHP Specific applications http://learn.iis.net/page.aspx/271/php http://learn.iis.net/page.aspx/271/php-applications-on-iis/ © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks trademar 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 inf provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. Want to ensure that a new process is created if no processes are available to handle a request? Run one instance per CPU with a minimum of 4 instances Set maxInstances to the lowest possible number under full load without consuming 100% CP Want to make sure that the existing process is recycled periodically? Set instanceMaxRequests (number of requests to process before recycling) as high as possible without destabilizing the app PHP process’ maximum request setting (PHP_fcgi_max_requests) has to be equal or higher than the instanceMaxRequests setting. <fastCgi> PHP\php-cgi.exe" <application fullPath="C:\PHP maxInstances="4" instanceMaxRequests="10000" idleTimeout="300"/> Want to set PHP specific environment variables in the web.config file? Use environmentVariables configuration setting to set PHP specific environment variables. <fastCgi> <application fullPath="C:\PHP\php-cgi.exe" fullPath="C: instanceMaxRequests=“10000"> <environmentVariables> <environmentVariable name=”PHP_FCGI_MAX_REQUESTS” value=”10000”/> </environmentVariables> </application> </fastCgi> Is your server under so much load that your clients are getting timeout responses? The FastCGI process will be terminated if it does not respond to FastCGI handler within specified time period. Set the requestTimeout (number of seconds <fastCgi> to wait for process to handle the request) <application fullPath="C:\PHP\php-cgi.exe" fullPath="C: value to be higher than the activityTimeout activityTimeout=“30" requestTimeout=“90"/> (number of seconds to wait for any process </fastCgi> activity) value. When did it start? What is it? PHP is a general-purpose scripting language PHP is primarily used as a server-side scripting language to create Web applications, but can also be used for command line scripting and for desktop applications PHP is Open Source and cross-platform PHP PHP succeeds an older product PHP/FI, which was created by Rasmus Lerdorf in 1995 PHP PHP 4.0 was first released in May 2000 (currently the most popular major release) PHP PHP 5.0 was released in July 2004 and the release of PHP 6.0 alpha is anticipated early in 2008 Why is it used? Easy to pick-up and understand, especially without a programming background Low cost of entry, including shared hosting that usually includes database storage Huge ecosystem, including applications, tools & documentation An example of a simple PHP script which sends the text "Hello World" to the browser: <html> <head> <title> PHP Hello World Example</title> </head> <body> <?php echo “Hello World!”; ?> </body> </html>