15
Web Server

Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Embed Size (px)

Citation preview

Page 1: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Web Server

Page 2: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

2

Web Server

• The main job of a Web server is to respond to requests from Web client computers by providing resources.

• There are 3 components of a Web server:

– Hardware

– Operating system software

– Web server software

Page 3: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Web Server

On the hardware side• Web server computers

– More memory, larger hard disk drives, and faster processors than typical PCs

• A web server stores a website's component files and delivers them to the end-user's device.

• It is connected to the Internet and can be accessed through a domain name like mozilla.org.

Page 4: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Web Server

• On the software side, a web server includes several parts that– control how web users access hosted files– generates and transmits responses to client

requests for Web resources.

Page 5: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Web Server

At the most basic level: – Whenever a browser needs a file hosted on a web

server, the browser requests the file via HTTP.– When the request reaches the correct web server

(hardware), the HTTP server (software) sends the requested document back, also through HTTP.

Page 6: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

HTTP

• HTTP is the protocol which the browser and web servers communicate by.

• HTTP is short for Hyper Text Transfer Protocol.• The web browser (client) initiates the

communication by opening a TCP/IP connection to the web server, and sending an HTTP request via the open connection.

• The web server responds by sending an HTTP response back.

Page 7: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

HTTP Request Types

• Request methods– Get

• Get (retrieves) information from a server• i.e: retrieve HTML document or image, fetch search

results

– Post• Post (sends) data to a server• i.e: authentication information, form data.

Page 8: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Web Server Response

The server can generate the response message in a variety of ways:

The server simply retrieves the file associated with the URL and returns the contents to the client.

The server may invoke a script that communicates with other servers or a back-end database to construct the response message.

Page 9: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

9

Two-Tier Client/Server Architecture

• Two-tier client/server architecture has one client and one server

Page 10: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

10

Three-Tier and N-Tier Client/Server Architectures

Three-tier architecture

Extends two-tier architecture to allow additional processing (e.g., collection of data from a database) before responses to requests are made

N-tier architectures

Higher-order architectures

Page 11: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Steps in Handling a Client Request

A Web server proceeds through the following steps in handling an HTTP request:

Read and parse the HTTP request message

for example GET the resource /foo.html

Translate the URL to a file name

for example the resource be located in the base directory such as /www, where the URL

http://www.bar.com/foo/index.html corresponds to

the file of www/foo/index.html

Determine whether the request is authorized Generate and transmit the response to the

requesting client

Page 12: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Access Control

• A Web server may limit which users can access certain resources. Access control requires a combination of authentication and authorization. – Authentication identifies the user who originated

the request.– Authorization determines which users have access

to a particular resource.

Page 13: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Authentication

• Most client-server systems authenticate a user by asking for a name and password.

• Web server must perform authentication for every request for a resource that has access restrictions.

• The server returns an HTTP response that indicates that the request requires authorization.

• The response also identifies what kind of authentication is required.

Page 14: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

Authorization To control access to Web resources, the server must

employ an authorization policy. A policy typically expressed in terms of an access control

list that enumerates the users who are granted or denied access to the resources.

In addition to checking the user name, the server may allow or deny access to the resource based on other information associated with the HTTP request, such as the host name or IP address of the requesting client.

Authenticating HTTP requests can impose a heavy load on the Web server.

Page 15: Web Server. 2 The main job of a Web server is to respond to requests from Web client computers by providing resources. There are 3 components of a Web

15

Types of Web Sites

• A Web site consists of a collection of web pages which are digital files generally written using HyperText Markup Language (HTML).

• Intranets: Corporate networks that house internal memos, corporate policy handbooks, and a variety of other corporate documents

• Extranets: Intranets that allow authorized parties outside the company to access information stored in the system

• Transaction-processing sites: Commerce sites that must be available 24 hours a day, seven days a week

• Content-delivery sites: Deliver content such as news, histories, summaries, and other digital information