Docsity

Understanding Web Servers: An Overview of HTTP Protocol, Apache Server, and Web Browsers, Slides of Web Application Development

Partial preview of the text

Download Understanding Web Servers: An Overview of HTTP Protocol, Apache Server, and Web Browsers and more Slides Web Application Development in PDF only on Docsity!

Internet Engineering

Web Servers

Introduction

• Company needs to provide various web services

  • Hosting intranet applications
  • Company web site
  • Various internet applications

• Therefore there is a need to provide http server

  • First we have a look at what http protocol is
  • Then we talk about Apache web server as leading web

server application

Web Browsers

• Provides access to a

Web server

• Basic components

– HTML interpreter

– HTTP client used to

retrieve HTML pages

• Some also support

– FTP, NTTP, POP, SMTP, …

Web Servers

• Definitions

  • A computer, responsible for accepting HTTP requests

from clients, and serving them Web pages.

  • A computer program that provides the above

mentioned functionality.

• Common features

  • Accepting HTTP requests from the network
  • Providing HTTP response to the requester
    • Typically consists of an HTML
  • Usually capable of logging
    • Client requests/Server responses

http protocol

• Created to define the communication between a

web server and a client

• It's the network protocol used to deliver virtually

all files and other data (collectively called

resources ) on the World Wide Web

• A browser is an HTTP client because it sends

requests to an HTTP server (Web server), which

then sends responses back to the client.

• The standard (and default) port for HTTP servers

to listen on is 80, though they can use any port.

Structure of http transactions

• Like most network protocols, HTTP uses the client-

server model: An HTTP client opens a connection and

sends a request message to an HTTP server ; the server

then returns a response message , usually containing

the resource that was requested

• Format of a http message:

_ Header1: value_

Header2: value

Header3: value

__

Header lines

• Typical request headers:

– From: email address of requester

– User-Agent: for example User-

agent: Mozilla/3.0Gold

• Typical response headers:

– Server: for example Server: Apache/1.2b3-dev

– Last-modified: fro example Last-Modified: , 19 Feb

2006 23:59:59 GMT

Message body

• In a response, this is where the requested

resource is returned to the client (the most

common use of the message body), or perhaps

explanatory text if there's an error.

• In a request, this is where user-entered data or

uploaded files are sent to the server.

• If an HTTP message includes a body, there are

usually header lines in the message that describe

the body. In particular,

  • The Content-Type: header gives the MIME-type of the

data in the body, such as text/html or image/gif.

  • The Content-Length: header gives the number of

bytes in the body.

HTTP methods

  • GET: request a resource by url
  • HEAD
    • is just like a GET request, except it asks the server to return the response headers only, and not the actual resource (i.e. no message body).
    • This is useful to check characteristics of a resource without actually downloading it, thus saving bandwidth.
  • POST
    • A POST request is used to send data to the server to be processed in some way, like by a CGI script.
    • There's a block of data sent with the request, in the message body. There are usually extra headers to describe this message body, like Content-Type: and Content-Length:.
    • The request URI is not a resource to retrieve; it's usually a program to handle the data you're sending.
    • The HTTP response is normally program output, not a static file.

HTTP 1.

• It is a superset of HTTP 1.0. Improvements

include:

– Faster response, by allowing multiple transactions

to take place over a single persistent connection.

– Faster response and great bandwidth savings, by

adding cache support.

– Faster response for dynamically-generated pages,

by supporting chunked encoding , which allows a

response to be sent before its total length is

known.

– Efficient use of IP addresses, by allowing multipleDocsity.com

HTTP 1.1 clients (cont.)

• Either support persistent connections or

include the “Connection: close” header with

each request

• Handle the “100 continue” response

HTTP/1.1 100 Continue

HTTP/1.1 200 OK

Date: Fri, 31 Dec 1999 23:59:59 GMT

Content-Type: text/plain

Content-Length: 42

some-footer: some-value

another-footer: another-value Docsity.com

HTTP 1.1 servers

• To comply with HTTP 1.1, servers must:

– Requiring the Host: Header. Without it server

must response with something like below:

HTTP/1.1 400 Bad Request

Content-Type: text/html

Content-Length: 111

_ No Host: header received_

HTTP 1.1 requests must include the Host: header.

__

– Accepting absolute URL’s

First Web Server

• Berners-Lee wrote two programs

– A browser called WorldWideWeb

– The world’s first Web server, which ran on

NeXSTEP

  • The machine is on exhibition at CERN’s public museum

Most Famous Web Servers

• Apache HTTP Server from Apache Software

Foundation

• Internet Information Services (IIS) from

Microsoft

• Sun Java Web Server from Sun Microsystems

– Formerly Sun ONE Web Server, iPlanet Web

Server, and Netscape Enterprise Server

• Zeus Web Server from Zeus Technology