112140947

Upload: rtr-jake-smart

Post on 14-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/27/2019 112140947

    1/13

    I I S 6 :T h e C o m p l e t e R e f e r e n c e

    Hethe HenricksonScott Hofmann

    McGraw-Hill/OsborneHLllHB DarmStddt New York Chicago San FranciscoLisbon L ondon Ma drid Mexico Cityu r n 1 1 1 1 i i u r n i i , f H15905980 Seoul Singapore Sydney Toronto

  • 7/27/2019 112140947

    2/13

    C o n t e n t sAcknowledgments xviiIntroduction xix

    IIS Fun dam entals 3Abo ut Windows Server 2003 4Ha rdw are Support in W indows 2003 4Installing W indow s 2003 5Installing IIS 6The IIS Subcom ponents 6IIS Services 8The IIS Directory Structure 9The Ad m inistration Web Site 9IIS H elp Files 10The Inetpu b Directory 10Accounts Used by IIS 10IUSR_COMPUTERNAME 10IWAM_COMPUTERNAME 10IIS WPG 10

    D3I

  • 7/27/2019 112140947

    3/13

    M f I I S 6 : T h e C o m p l e t e R e f e r e n c e

    Na viga ting IIS 11The Microsoft M anagem ent Console 11The Metabase 13Metabase History 14Backing Up and Restoring the Metabase 14Editing the Metabase 16The Metabase Schema 17IIS 6 Architecture 17Worker Process Isolation M ode 18Application Pools 19Hea lth M onitoring 19Orp hanin g Worker Processes 20Scalability 20Web Ga rdens 20

    D1I 2 The WWW Service 21Using the IIS MMC 22Web Site Directories 22Crea ting Virtual Directories 23Saving a Web Site Con figuration to a File 24Creating a Ne w Site 25Accessing Con figuration Tabs 26The Web Site Prop erties Tabs 26Web Site Tab 26The Performance Tab 31The ISAPI Filters Tab 32The Ho m e Directory Tab 34The Doc um ents Tab 44The Directory Security Tab 46The HTTP He aders Tab 56The Custo m Errors Tab 60The BITS Server Exten sion Tab 62The Server Extensions 2002 Tab 64Global Web Sites Prop erties Tabs 70The Service Tab 70Oth er Tabs 73Directory Level Prop erties Tabs 74File Level Prop erties Tabs 74App lication Pools 75Creating an Application Pool 75Application Pool Properties 76

  • 7/27/2019 112140947

    4/13

    C o n t e n t s vff

    IZJI I 3 The FTP Service 83Managing the FTP Service 84

    Viewing FTP Service Status 86Starting and Stopping FTP Sites 87Current Sessions 88Managing FTP Site Contents Using the MMC 89Refresh 91

    Creating and Configuring FTP Sites 91FTP Site Creation Wizard 92Creating FTP Sites Using the iisftp Script 97Using Export Definition Files 100Creating Virtual FTP Directories 102FTP Sites Node Configuration 103

    Advanced IIS MMC Configurations 103Connections 104Directory SecurityIP Address Restrictions 104Directory Listing StyleMS-DOS or UNIX 105Messages 105Logging Configuration 105

    4 The SMTP Service 109Managing the SMTP Service 110

    Viewing SMTP Virtual Server's Status Il lStarting, Pausing, and Stopping SMTP Virtual Servers . . . I l lStarting, Pausing, and Stopping SMTP Service 112Creating and Configuring SMTP Virtual Servers 114New SMTP Virtual Server Wizard 115Configuring an SMTP Virtual Server 118Connection Settings 119Logging Configuration 120Managing Inbound Messages 121Managing Message Delivery 123

    SMTP Server Access Security 128User Administrative Permissions 128Authenticating Incoming Connections 128Restricting Based on IP Address or Domain Name 129

    LDAP Routing 130SMTP Domains 131

    Creating Domains 131Configuring Domains 133

  • 7/27/2019 112140947

    5/13

    v i i i U S 6 : T h e C o m p l e t e R e f e r e n c e

    CI3ifi 5 T heN N T PServ ice 135Installing the NNT P Service 136Adm inistering NN TP 138Ad m inistering NN TP Service 138Ad m inistering an NN TP Virtual Server 139Configuring an NN TP Virtual Server 141Gen eral Tab Settings 142Access Tab Settin gs 144Setting s Tab 148Secu rity Tab 150Creating a N ew NN TP Virtual Server 151Newsgroups 153Limit Gro ups Enu me ration 153Create a New New sgroup 153Configuring N ew sgro up Properties 154

    Adm inistering New sgroups 154Exp iration Policies 154N ew NN TP Expiration Policy Wizard 155Configu ring Exp iration Policies 156Virtual Directories N od e 157Ne w NN TP Virtual Directory Wizard 158Configuring an NN TP Virtual Directory 158Cu rren t Sessions 160

    IIS AdministrationD l l 6 Security 165Internet Security Backg round 166W hy Vulnerabilities H app en 166H ow You Can Protect Your System 167Co mmon Types of Security Issues 167Viruses 167Trojan Horses 168Worms 168

    How to Protect Yourself from Attack 170The Secure W indow s Initiative 170Patch ing Your System 171Secu ring IIS 174Do n't Install Com pone nts You Do n't Ne ed 174Do n't Turn On Directory Browsing 175Lock Dow n cmd.exe 175Set Execute Perm issions for Your Web Site 175

  • 7/27/2019 112140947

    6/13

    C o n t e n t s : IX

    Don't Set Up W rite for Your Web Site 176Avoid Basic Au then tication 176Set Up Logg ing 176Un m ap Un needed IS API App lication Extensions 176Hide the Fact that You're Using Scripting 177Use SSL for Sensitive Web Sites 177Alw ays Use NTFS Permissions 178Be on the Look out for Ha ckers 178Try to Ha ck In 178Control IIS Servers 178Security Policies in Windows Server 2003 178Crea ting a Local Security Policy 179Using the Local Security Policies 180User Acco unt Security 181Force Strong Passw ords 181Enable Acc ount Lockout 182Force Periodic Passw ord Chang es 183Remem ber Past Passw ords 183Set a M inim um Passw ord Age 184Use One-Way Encryption for Passw ord Storage 185Do n't Create User Accounts with Easy Passw ords 185Web Service Extensions 185Allow ing Web Service Extensions to Run 186Proh ibiting a Web Service Extension from Ru nnin g 186Ad ding a Ne w Web Service Extension 187Allow All Web Service Extensions for a SpecificApplication 187Prohibit All Web Service Extensions 187Mo difying the Prop erties for a Web Service Extension . . . 188

    Authentication 189An onym ous Authe ntication 190Logon Types 191Sub authe ntication in IIS 191Basic Au thentic ation 192Basic Authen tication Tokens 192User Accounts and Basic Authe ntication 193Digest Au thentic ation 193Ad vanced Digest Authen tication 194Integrated W indow s Au thentication 196Ab out Microsoft Ne gotiate 196Abo ut NTLM Au thentication 196Abo ut Kerberos Au thentication 197

  • 7/27/2019 112140947

    7/13

    I I S 6 : T h e C o m p l e t e R e f e r e n c e

    .NET Passport Au thentication 198Establishing .NET Pas spo rt Service 199Setting Up the Site for .NET Pas spor t 202Using Mu ltiple Au thentication Schemes 2038 TC P/IP and DNS 205The History of TC P/I P and the Internet 206The ARPANET 206Architectural Models for Com mu nications Protocols 206The DoD Protocol Mo del 207The OSI Protocol Model 208Com mu nicating Across the Layers 209Encapsulation 209Add ressing in TC P/IP 210MAC Ad dresses 210

    IP Ad dresses 210IP Protoc ol Versions 211IPv4 211IPv6 212The T C P , UDP, an d ICMP Protocols 213Using TC P/IP 213Choosing an IP Ad dress 214Con figuring IPv4 214The IP Settings Tab 214The DN S Configuration Tab 217The W INS Con figuration Tab 218The Option s Tab 220Con figuring IPv6 221Installing IPv6 221Usin g the NETSH Interface 222Chan ging the Prim ary DNS Suffix 222DNS and W indow s Server 2003 223Histo ry of DNS 223ABrief Ove rview of DNS and TLDs 223How DNS Nam es Are Resolved 226

    DNS Zone Storage 227Storing Your Zo ne Inform ation in a Text File 227Storing Z one Information in Active Directory 229DNS Dynamic Upd ates 230Regular Dynam ic U pda te 231Secure Dynam ic U pda te 231W indows Server 2003 as a Cac hing Server 231Resource Record Types in DN S 231

  • 7/27/2019 112140947

    8/13

    C o n t e n t s x!

    Installing D NS on Y our WS03 Server 234The DNS MMC 235Event Viewer 235Forward Lookup Zones 235Reverse Lookup Zones 236Using Round Robin DNS 240Us ing a Ho sts File for Nam e Resolution 241

    D I3 9 A dm inistration Tasks 243Editing the XMLM etabase File 244Editing W hile the Server Is Runn ing 244Editing W hile the Server Is Stopp ed 245Using the ADSI Provider 245IIS ADSI Objects 245IIS ADSI Prop erties 246IIS ADSI M ethods 247Using the WMI Provider 248WMI or ADSI? 248Scripting w ith WM I 249Us ing the VBScript Utilities Pro vide d w ith IIS 251Remote Ad min istration with the HTML Interface 253Using the Remote Ad m inistration Site 254

    10 Encryption 259Abou t Digital Certificates 260Certificate Keys 260W ho Are Certificate Au thorities? 265How Server Certificates Work with SSL 265How Client Certificates Work 266Creating Your O wn CA 267Choosing W hich Type of CA to Install 267Installing the Certificate Services on Your Server 268Creatin g a Certificate Request w ith IIS 272Sending a Request to Your Ow n CA 273Sending an SSL Certificate R equest to a

    Com mercial CA 275Send ing a Request for a Client Certificate from theCertification Au thority MMC Snap-in 277Send ing a Request for a Client C ertificatefrom the Web 278Issuing or Denying Certificates from a Standalone CA . . . 278Do wn loading a Web Browser Certificatefrom the Web 278Insta lling an SSL Certificate 279

  • 7/27/2019 112140947

    9/13

    x i l I I S 6 : T h e C o m p l e t e R e f e r e n c e

    Con figuring SSL Settings 280Requiring Secure Com mu nication 281M app ing Client Certificates to User Acc ounts 281Backing Up and Restoring a Certificate 285D l i 1 1 Logging 289Log File Form ats 291Enab ling Logging for Your Site 291Log File Form ats 295W3C Extended Log File Form at 295Microsoft IIS Log Format 302NCSA Com mo n Log File Form at 303ODBC Logg ing 306Using Custom Logging Modules 312

    Setting Up a Cus tom Logging M odule w ith IIS 312Cen tralized Binary Logg ing 315Setting Up Centralized Binary Logging 315Crun ching the Data 315

    IIS Programming12 A S P Programming 319Ov erall Arch itecture of ASP 320

    Ed iting ASP files , 321Setting U p IIS to Ho st ASP 324ASP Fundam entals 327ASP Objects 328Respo nse Object 329Application Object 329Req uest Object 330Session Object 338Server Object 343Usin g XML 356M aking a Transformation Using XSL 357

    13 COM W e b Programming 363Introd uctio n to VB6 365Setting Up an ActiveX DLL Project 366Crea ting a Class Interface in an ActiveX DLL 369Object Brow ser 369Building a Test Harn ess 372

  • 7/27/2019 112140947

    10/13

    C o n t e n t s ! x i i i

    Deploying a COM DLL 374Using regsvr32 375Using Co m pon ent Services 375Unit Test a COM DLL 386Using V B in COM 388Building a COM Object in V B 6 w ith Data Access Sup port 389Prop erties in Classes 391Database Conn ection Crede ntials 391Error H and ling 395Writing to Da tabase 397Serializing into XML 406Enhanced Test H arness 408Deploy to COM + w ith Co nstructor String 410Integrating XML an d XSL 412

    II 14 ASP.NET Web Forms 421Overview of the Web Forms Architecture 422Ge tting Started in Visual Stud io .NET 424Web Form FileASPX 426Web Form Co debe hind Fileaspx.cs 430Assem blylnfo.es File 433Project Filecsproj 433Project Weblnfo Filecsproj .webinfo 434Discovery Inform ation Filevsdisco 434Web Co nfiguration Filew eb.config 435Building Web Form s 436Editing Co de for a Data-O riented Web Form 438Data Form W izard 449Using XML 453

    Ii 15 ASP.NET Web Services 457Web Services Architecture 458Creating a Web Service Using Visual Stud io .NET 459Using the Co m pon ent Designer 462Event Log Co m pon ent 480Application Security 482Testing the Web Service 486W riting a Test Harness 489

    II 16 ATLServer 493A T L Server Architecture Ov erview 494Create a Simple A T L Server Project 497

  • 7/27/2019 112140947

    11/13

    . I I S 6 : T h e C o m p l e t e R e f e r e n c e

    Using the A T L Server Project W izard 503Project Se ttings 503Server O ptions in the ATL Server Project W izard 504Ap plication Op tions in the ATL Server Project W izard . . . 509Developer S upp ort O ption s in the ATL ServerProject W izard 512ATL Server Project W izard Com pletion 514Server Response Files 514Tags in Server Response Files 514Request H and ler DLL 518

    1 7 ISAPI Extensions 523ISAPI Architecture Ov erview 525URL Anatom y 525ISAPI Extensions Interacting w ith I I S 526ISAPI Co m pared to ATL Server 528Building a Simple ISAPI Extension 528Definition Export File 533ISAPI Extension M ain En try Point 534Deploy the HelloW orld ISAPI 538Extracting Inform ation from IIS 542Building XML Rep resenting the ServerVariables Values 545Special Case of ALL_HTTP Server Variable 545Parsing the He ader-V alue Pair 555Assem bling the Rem aining XML Elements 557ISAPI Project Tem plate W izard 563Creating an ISAPI Extension in Visual Stud io .NET 564

    ; j:y ': . , ,; IIS Extras , . , . , : _ J1 8 Software Process and M ethodo logy forWeb Applications 571Definition of Terms 572The Unified Process 573An A dap tation of the Unified Process 574Define Project Scope 576Statem ent of Work 577Scope Estim ate 578Scope Project Plan 578

  • 7/27/2019 112140947

    12/13

    C o n t e n t s XV

    Define Fun ctionality 581Functional Specification 582Gathering Functional Requ irements 590Define the Design 591W hat Is a Facade? 592Produ ce the Facade 594Presenting the Facade 595Write the Technical Specification 597Technical Specification Tem plate 598Fun ctional Test Scripts 600Build the Solution 601Test the Solution 603Deploy the Solution 604After the Project Co m pletion 605

    19 Bringing It All Together: Cre ating Your O w n Web SiteUsing IIS 607Get a Dom ain Na m e 608Get an IP Ad dress 609Set U p DN S 610Prep are the Server 612Checking Server H arde ning 612Setting U p the Directory for the Web Site 613Securing the NTFS Perm issions for the Site 613A dd the Web Sites to IIS 616Enab le ASP 616Configure the Ap plication Pool 616Make the Code 617Make a Database 622Get a Certificate for the Test Site 623Get a Certificate for the Production Site 625Set U p the Web Site Security 626Create a User Account 626Set Up NTFS Perm issions 627Set Up the Au thentication Op tions 628Test the Code 629Roll into Prod uction 629

    20 Troubleshooting 631Log Files 632Abo ut W3C Logging 632The W indow s Event Viewer 636MIME M apping s 638

  • 7/27/2019 112140947

    13/13

    v i M S 6 : T h e C o m p l e t e R e f e r e n c e

    Dyn amic Web Co ntent 639Perm issions Issues 640W orker Processes 640Worker Process Iden tity 640Worker Process Recycling 641Web Service Sh utdo wn 641Performance M onitoring 642Real-Time M onitoring 644Usin g Co unter Logs 644Using Alerts in Performance M onitor 648The General Tab 648The Action Tab 650The Schedu le Tab 651

    G H Appendix : X M L Escape Values 653 H Index . . . . ' . 675