Introduction server Construction

23
WEB SERVERS Hanulso 23 기 기기기 1

Transcript of Introduction server Construction

WEB SERVERS

Hanulso 23 기

왕찡위

1

WEB SERVERS (IIS AND APACHE)

2

Outline1Introduction2 HTTP Request Types3 System Architecture4 Client-Side Scripting versus Server-Side Scripting5 Accessing Web Servers6 Microsoft Internet Information Services (IIS)

6.1 Microsoft Internet Information Services (IIS) 6.06.2 Microsoft Internet Information Services (IIS) 7.0

7 Apache Web Server8 Requesting Documents

8.1 XHTML8.2 ASP.NET8.3 PHP

9 Web Resources

OBJECTIVES

To understand a Web server’s functionality. To introduce Apache Web server. To learn how to request documents from a Web

server.

3

1  INTRODUCTION

Web server Responds to client requests by providing

resources URI (Uniform Resource Identifier) Web server and client communicate with

platform-independent Hypertext Transfer Protocol (HTTP)

4

1  INTRODUCTION

5

IIS 6.0 IIS 7.0 Apache Web server Company Microsoft

Corporation Microsoft Corporation

Apache Software Foundation

Platforms Windows 2003, Windows XP

Windows Server 2008 Windows NT/2000/XP, Mac OS X, Linux and other UNIX-based platforms, experimentally supports Windows XP/7

Brief description

The most popular Web server for Windows 2003.

The newest release of IIS from Microsoft.

Currently the most popular Web server.

Price Included with Windows 2003 and Windows XP.

Included with Windows Server 2008

Freeware.

Fig. 21.1 Web servers discussed in this chapter.

WEB SERVER ARCHITECTURE

6

HOW THE WWW WORKS

7

DOMAIN NAME SERVER SYSTEM

8

EXAMPLE OF AN HTTP REQUEST FROM A WEB BROWSER

9

GET http://www.kelley.indiana.edu/ardennis/home.htm HTTP/1.1Date: Mon 06 Aug 2008 17:35:46 GMTUser-Agent: Mozilla/6.0Referer: http://www.indiana.edu/~aisdept/faculty.htm Request Header

]- Request Line

]- Web browser (this is Netscape)

Command URL HTTP version

URL that contained the link to the requested URL

HTTP RESPONSE FROM A WEB SERVER

HTTP/1.1 200 OK ]- Response StatusDate: Mon 06 Aug 2008 17:35:46 GMT ]- DateServer: NCSA/1.3 ]- Web serverLocation: http:// www.kelley.indiana.edu/adennis/home.htm ]- URLContent-type: text/html ]- Type of file<html><head><title>Allen R. Dennis</title></head><body><H2> Allen R. Dennis </H2><P>Welcome to the home page of Allen R. Dennis</P>

</body></html> 10

HTTP version Status code Reason

Response Header

Response Body

2  HTTP REQUEST TYPES GET (default) and POST do basically the

same thing: Send data from the client to the server. However, they have some differences:

GET Appends form data directly to the end of the URL—

visible to users (not suitable for sending passwords) Limited to 2,048 characters for the entire URL Result page can be bookmarked and cached

POST Sends form data in the HTTP request—invisible to

users Virtually no limit (but check your specific

configuration) Results are not cacheable or bookmarkable

11

3  SYSTEM ARCHITECTURE Multi-tier application (n-tier application)

Information tier (data or bottom tier) Maintains data for the application Stores data in a relational database management

system (RDBMS)Middle tier

Implements business logic and presentation logic Control interactions between application clients and

application dataClient tier (top tier)

Application’s user interface Users interact directly with the application through the

client tier12

N-TIER CLIENT-SERVER ARCHITECTURE

13

4  CLIENT-SIDE SCRIPTING VERSUS SERVER-SIDE SCRIPTING Client-side scripts

Validate user input Reduce requests needed to be passed to server Access browser Enhance Web pages with DHTML, ActiveX

controls, and applets Server-side scripts

Executed on serverGenerate custom response for clientsWide range of programmatic capabilitiesAccess to server-side software that

extends server functionality 14

INSTALLING A WEB SERVER15

HOSTING A WEBSITE:SELF HOSTING

Install a web server on a computer Local access

Using domain <localhost>or IP address 127.0.0.1Necessary for server-side programming

development Global access

Register a human-readable domain nameObtain IP address

Static: Costs more Dynamic: Needs dynamic DNS system, e.g.

http://www.dyndns.com/ 16

HOSTING A WEBSITE:HOSTING SERVICE

Register a domain name Assign name servers Host takes care of IP addressing

Develop website locally Upload website via FTP for global access

E.g. Filezilla

17

WEB SERVER ARCHITECTURE LAMP: Most popular—fully open source

Linux for operating systemApache for web serverMySQL for databasePHP for server-side scripting

Others:WAMP: Uses Windows for operating

system, with Apache, MySQL, and PHPWISA: Full Microsoft package

Windows Internet Information Server (IIS) SQL Server (enterprise) or Access (small-scale) ASP or ASP.NET 18

7  APACHE WEB SERVER

Currently the most popular Web server Stability Efficiency Portability Open-source

19

ALL-IN-ONE APACHE/MYSQL/PHP PACKAGES APMSETUP(recommended)

Includes PHPMyAdmin for administering MySQL database

Installation and configuration AbriaSoft Merlin Desktop Edition

Includes PHPMyAdmin WAMP Server PHP Triad

20

REQUESTING XHTML OR PHP DOCUMENTS Request PHP documents from Apache Save PHP documents in the www

folder for EasyPHP (htdocs is the default Apache folder name)

Launch web browserWith EasyPHP, right-click on the status bar

icon and click “Local Web” Enter PHP document’s location in

Address field, starting with http://localhost/ or http://127.0.0.1/ 21

8.1 XHTML AND PHP

22

Fig. 21.15 Requesting test.html from IIS 6 or Apache.

Fig. 21.23 Requesting test.php from Apache.

THANK YOU

23