Presentation is loading. Please wait.

Presentation is loading. Please wait.

 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.

Similar presentations


Presentation on theme: " 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3."— Presentation transcript:

1  2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture 21.4 Client-Side Scripting versus Server-Side Scripting 21.5 Accessing Web Servers 21.6 Microsoft Internet Information Services (IIS) 21.7 Microsoft Personal Web Server (PWS) 21.8 Apache Web Server 21.9 Requesting Documents 21.9.1 XHTML 21.9.2 ASP 21.9.3 Perl 21.9.4 Python 21.9.5 PHP 21.10 Internet and World Wide Web Resources

2  2001 Prentice Hall, Inc. All rights reserved. 2 21.1 Introduction Web server –Specialized software that responds to client requests by providing resources –When users enter URL into Web browsers, they request specific documents from Web server –Maps URL to file on server and returns requested document to client –Communicates with client using HTTP Protocol for transferring requests and files over the Internet Introduce three Web servers (Fig. 21.1) –Internet Information Services (IIS), Personal Web Server (PWS) and Apache Web Server

3  2001 Prentice Hall, Inc. All rights reserved. 3 21.1 Introduction

4  2001 Prentice Hall, Inc. All rights reserved. 4 21.2 HTTP Request Types Also known as request methods Most popular are get and post –Retrieve and send client form data to Web server –get request Sends form content as part of URL Retrieves appropriate resource from Web server Limits query to 1024 characters –post request Updates contents of Web server (posting new messages to forum) Has no limit for length of query Not part of URL and cannot be seen by user

5  2001 Prentice Hall, Inc. All rights reserved. 5 21.2 HTTP Request Types Posts data to server-side form handler Browsers cache (save on disk) Web pages –Allows for quick reloading –Cache responses to get request –Do not cache responses to post request

6  2001 Prentice Hall, Inc. All rights reserved. 6 21.3 System Architecture Web server part of multi-tier application –Divide functionality into separate tiers Logical groupings of functionality Can reside on same computer or on different computers Following diagrams illustrates 3-tier application

7  2001 Prentice Hall, Inc. All rights reserved. 7 21.3 System Architecture Fig. 21.2Three-tier application model.

8  2001 Prentice Hall, Inc. All rights reserved. 8 21.3 System Architecture Information tier –Referred to as data tier or bottom tier –Maintains data for application –Stores data in relational database management system Middle tier –Implements business logic and presentation logic –Controls interactions between application clients and application data –Acts as intermediary between data in information tier and application clients

9  2001 Prentice Hall, Inc. All rights reserved. 9 21.3 System Architecture Middle tier, cont. –Controller logic Processes client requests from top tier Retrieves data from database –Presentation logic Processes data from information tier Presents content to client –Business logic Enforces business rules –Dictates how clients can access application data and how applications process data Ensures data validity before updating database

10  2001 Prentice Hall, Inc. All rights reserved. 10 21.3 System Architecture Client tier –Referred to as top tier –Application’s user interface –Users interact with application through user interface –Interacts with middle tier to make requests and to retrieve data from information tier –Displays data to user

11  2001 Prentice Hall, Inc. All rights reserved. 11 21.4 Client-Side Scripting versus Server- Side Scripting Client-side scripting –Validates user input –Accesses the browser –Enhances Web pages with ActiveX® controls, applets, etc. –Manipulates browser documents Client-side validation –Reduces number of requests that need to be passed to server Client-side scripting limitations –Browser dependency –Viewable to users through View Source command JavaScript most popular client-side script

12  2001 Prentice Hall, Inc. All rights reserved. 12 21.4 Client-Side Scripting versus Server- Side Scripting Server-side scripts –Provides programmers greater flexibility –Generates custom responses for clients –Contains greater programmatic capabilities than client-side equivalents –Has access to server-side software that extend server functionality

13  2001 Prentice Hall, Inc. All rights reserved. 13 21.5 Accessing Web Servers Requesting documents –Must know machine name on which Web server resides –Through local Web servers or remote Web servers –Through domain name or Internet Protocol (IP) address Local Web server –Resides on users’ machines –Requests documents in two ways Machine name localhost –Host name that references local machine

14  2001 Prentice Hall, Inc. All rights reserved. 14 21.5 Accessing Web Servers Remote Web server –Resides on different machines Domain name –Represents group of hosts on Internet –Combines with how name ( www ) and top-level domain to from fully qualified host name Top-level domain (TLD) –Describes type of organization that owns domain name.com or.org Fully qualified host name –Provides user friendly way to identify site on Internet

15  2001 Prentice Hall, Inc. All rights reserved. 15 21.5 Accessing Web Servers IP address –Unique address for locating computers on Internet Domain name server (DNS) –Maintains database of host names and corresponding IP addresses –Translates fully qualified host name to IP address Known as DNS lookup

16  2001 Prentice Hall, Inc. All rights reserved. 16 21.6 Microsoft Internet Information Services (IIS) IIS 5.0 –Enterprise-level Web server –Included with Windows 2000 –Allows computer to serve documents Internet Services Manager (Fig. 21.3) –Open Control Panel, double click Administrative Tools icon, then double click Internet Services Manager icon –Administration program for IIS –Place documents to be requested in default directory or virtual directory Default: C:\Inetpub\Wwwroot Virtual: alias for existing directory on local machine

17  2001 Prentice Hall, Inc. All rights reserved. 17 21.6 Microsoft Internet Information Services (IIS) Fig. 21.3 Internet Services Manager dialog.

18  2001 Prentice Hall, Inc. All rights reserved. 18 21.6 Microsoft Internet Information Services (IIS) Default FTP Site and Default Web Site –Permit transferring documents between computer and server –HTTP used frequently to request documents Default SMTP Virtual Server –Allows for creation of mail server Create virtual directory in Default Web Site –Most Web documents reside in Webpub directory Right click Webpub, select New, then Virtual Directory Initiates Virtual Directory Creation Wizard (Fig. 21.4) –Guides user through virtual directory creation process

19  2001 Prentice Hall, Inc. All rights reserved. 19 21.6 Microsoft Internet Information Services (IIS) Fig. 21.4 Virtual Directory Creation Wizard welcome dialog.

20  2001 Prentice Hall, Inc. All rights reserved. 20 21.6 Microsoft Internet Information Services (IIS) Virtual Directory Alias (Fig. 21.5) –Enter name for virtual directory Name should not conflict with an existing virtual directory Web Site Content Directory (Fig. 21.6) –Enter path of directory containing Web documents Access Permissions (Fig. 21.7) –Presents security level choices –Select access level appropriate for Web document

21  2001 Prentice Hall, Inc. All rights reserved. 21 21.6 Microsoft Internet Information Services (IIS) Fig. 21.5 Virtual Directory Alias dialog.

22  2001 Prentice Hall, Inc. All rights reserved. 22 21.6 Microsoft Internet Information Services (IIS) Fig. 21.6 Web Site Content Directory dialog.

23  2001 Prentice Hall, Inc. All rights reserved. 23 21.6 Microsoft Internet Information Services (IIS) Access Permissions (Fig. 21.7) –Presents security level choices –Select access level appropriate for Web document –Read allows users to read and download files –Run Scripts allows scripts to run in directory –Execute allows applications to run in directory –Write allows Web page to accept user input –Browse allows users to navigate between documents –Read and Run Scripts selected by default

24  2001 Prentice Hall, Inc. All rights reserved. 24 21.6 Microsoft Internet Information Services (IIS) Fig. 21.7 Access Permissions dialog.

25  2001 Prentice Hall, Inc. All rights reserved. 25 21.7 Microsoft Personal Web Server (PWS) PWS –Scaled-down version of IIS –Intended for personal computers (PC) –Ideal for educational institutions, small businesses and individuals –Does not require PC to be used exclusively as Web server Personal Web Manager (Fig. 21.8) –Administration program for PWS –Place documents to be requested in default directory or virtual directory Default: C:\Inetpub\Wwwroot Virtual: alias for existing directory on local machine

26  2001 Prentice Hall, Inc. All rights reserved. 26 21.7 Microsoft Personal Web Server (PWS) Fig. 21.8 Personal Web Manager dialog.

27  2001 Prentice Hall, Inc. All rights reserved. 27 21.7 Microsoft Personal Web Server (PWS) Edit Directory (Fig. 21.9) –Directory field Enter directory path that contains Web documents –Alias field Enter name to virtual directory –Access section Select security level for virtual directory Read allows users to read and download files Execute allows applications to run in directory Scripts allows scripts to run in directory Read and Scripts selected by default

28  2001 Prentice Hall, Inc. All rights reserved. 28 21.7 Microsoft Personal Web Server (PWS) Fig. 21.9Creating a virtual directory in PWS in Edit Directory.

29  2001 Prentice Hall, Inc. All rights reserved. 29 21.8 Apache Web Server Apache –Maintained by Apache Software Foundation –Currently most popular Web server Stable Efficient Portable –Successively select Start, Programs, Apache httpd Server, Control Apache Server and Start (Fig. 21.10)

30  2001 Prentice Hall, Inc. All rights reserved. 30 21.8 Apache Web Server Fig. 21.10Starting the Apache Web server. (Courtesy of The Apache Software Foundation.)

31  2001 Prentice Hall, Inc. All rights reserved. 31 21.9 Requesting Documents Demonstrate requesting five different documents –XHTML, Active Server Pages (ASP), Perl, Python and PHP –Discuss serving these documents using IIS, PWS and Apache

32  2001 Prentice Hall, Inc. All rights reserved. 32 21.9.1 XHTML IIS, PWS and Apache support XHTML IIS or PWS –Copy test.html into directory that references virtual directory ( C:\Chapter21Examples ) Cannot copy file into a virtual directory ( Chapter21Test ) –Launch Internet Explorer and enter XHTML document’s location in Address field (Figs. 21.11 and 21.12) Apache –Copy test.html to htdocs directory (default directory) –Launch Internet Explorer and enter XHTML document’s location in Address field (Fig. 21.13)

33  2001 Prentice Hall, Inc. All rights reserved. 33 21.9.1 XHTML Fig. 21.11Requesting test.html from IIS. Fig. 21.12Requesting test.html from PWS. Notice different URL’s in Address field localhost references local machine For IIS, we created virtual directory in Webpub directory

34  2001 Prentice Hall, Inc. All rights reserved. 34 21.9.1 XHTML Fig. 21.13Requesting test.html from Apache. Since htdocs is the default directory, we do not need to enter directory name in URL

35  2001 Prentice Hall, Inc. All rights reserved. 35 21.9.2 ASP IIS and PWS support ASP documents IIS and PWS –Copy test.asp into directory that references virtual directory ( C:\Chapter21Examples ) –Launch Internet Explorer and enter ASP document’s locations in Address field (Figs. 21.14 and 21.15) Apache –Does not support ASP documents

36  2001 Prentice Hall, Inc. All rights reserved. 36 21.9.2 ASP Fig. 21.14Requesting test.asp from IIS. Fig. 21.15Requesting test.asp from PWS.

37  2001 Prentice Hall, Inc. All rights reserved. 37 21.9.3 Perl IIS, PWS and Apache support Perl documents IIS and PWS –Copy test.pl into directory that references virtual directory ( C:\Chapter21Examples ) –Launch Internet Explorer and enter Perl document’s location in Address field (Figs. 21.16 and 21.17) Apache –Copy test.pl to cgi-bin directory Perl documents must reside in this directory –Launch Internet Explorer and enter Perl document’s location in Address field (Fig. 21.18)

38  2001 Prentice Hall, Inc. All rights reserved. 38 21.9.3 Perl Fig. 21.16Requesting test.pl from IIS. Fig. 21.17Requesting test.pl from PWS.

39  2001 Prentice Hall, Inc. All rights reserved. 39 21.9.3 Perl Fig. 21.18Requesting test.pl from Apache. cgi-bin is required in URL; it is not default directory

40  2001 Prentice Hall, Inc. All rights reserved. 40 21.9.4 Python IIS, PWS and Apache support Python documents IIS and PWS –Copy test.py into directory that references virtual directory ( C:\Chapter21Examples ) –Launch Internet Explorer and enter Python document’s location in Address field (Figs. 21.19 and 21.20) Apache –Copy test.py to cgi-bin directory Python documents must reside in this directory –Launch Internet Explorer and enter Python document’s location in Address field (Fig. 21.21)

41  2001 Prentice Hall, Inc. All rights reserved. 41 21.9.4 Python Fig. 21.19Requesting test.py from IIS. Fig. 21.20Requesting test.py from PWS.

42  2001 Prentice Hall, Inc. All rights reserved. 42 21.9.4 Python Fig. 21.21Requesting test.py from Apache.

43  2001 Prentice Hall, Inc. All rights reserved. 43 21.9.5 PHP IIS, PWS and Apache support PHP documents IIS and PWS –Copy test.php into directory that references virtual directory ( C:\Chapter21Examples ) –Launch Internet Explorer and enter PHP document’s location in Address field (Figs. 21.22 and 21.23) Apache –Copy test.php to htdocs directory –Launch Internet Explorer and enter PHP document’s location in Address field (Fig. 21.24)

44  2001 Prentice Hall, Inc. All rights reserved. 44 21.9.5 PHP Fig. 21.22Requesting test.php from IIS. Fig. 21.23Requesting test.php from PWS.

45  2001 Prentice Hall, Inc. All rights reserved. 45 21.9.5 PHP Fig. 21.24Requesting test.php from Apache.


Download ppt " 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3."

Similar presentations


Ads by Google