WebServer A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol (HTTP), serves the files that.

Slides:



Advertisements
Similar presentations
Hypertext Transfer PROTOCOL ----HTTP Sen Wang CSE5232 Network Programming.
Advertisements

DT228/3 Web Development WWW and Client server model.
World Wide Web Basics Original version by Carolyn Watters (Dalhousie U. Computer Science)
HTTP – HyperText Transfer Protocol
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
How the web works: HTTP and CGI explained
The abs_path in a URI If the abs_path is not present in the URL, it must be given as "/" in a Request-URI for a resource. Thus, if a user points a browser.
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 23 – Internet Applications Internet Directory.
HTTP Presented By: Holly Mortinson Amy Drout Kyle Balmer & Matt Conklin.
Programming Project #3CS-4513, D-Term Programming Project #3 Simple Web Server CS-4513 D-Term 2007 (Slides include materials from Operating System.
1 Web Search Interfaces. 2 Web Search Interface Web search engines of course need a web-based interface. Search page must accept a query string and submit.
1 The HyperText Transfer Protocol: HTTP Nick Smith Stuart Alley Tara Tjaden.
Definitions, Definitions, Definitions Lead to Understanding.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
The abs_path in a URI If the abs_path is not present in the URL, it must be given as "/" in a Request-URI for a resource. Thus, if a user points a browser.
Hypertext Transport Protocol CS Dick Steflik.
Client, Server, HTTP, IP Address, Domain Name. Client-Server Model Client Bob Yahoo Server yahoo.com/finance.html A text file named finance.html.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
INTRODUCTION TO WEB DATABASE PROGRAMMING
COMP3016 Web Technologies Introduction and Discussion What is the Web?
Chapter 7: Internet-Based Applications Business Data Communications, 6e.
Chapter 1: Introduction to Web
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
Application Protocols: HTTP CSNB534 Semester 2, 2007/2008 Asma Shakil.
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
ارائه دهنده : مرضیه نوریان.  RFC مخفف عبارت Request For Comment است.  RFC ها مراجعي بزرگ درباره مسائل مربوط به شبكه هستند كه هر كدام از آناه درباره.
HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other.
The HyperText Transfer Protocol. History HTTP has been in use since 1990 (HTTP/0.9) HTTP/1.0 was defined in RFC 1945 (May 1996) and included metainformation.
Web HTTP Hypertext Transfer Protocol. Web Terminology ◘Message: The basic unit of HTTP communication, consisting of structured sequence of octets matching.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
HTTP Hypertext Transfer Protocol
1 Welcome to CSC 301 Web Programming Charles Frank.
Web Client-Server Server Client Hypertext link TCP port 80.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
Web Technologies Interactive Responsiveness Function Hypertext Web E-Publishing Simple Response Web Fill-in Forms Object Web « Full-Blown » Client/Server.
Internet and Intranet Fundamentals
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
Jan.2001C.Watters1 World Wide Web Basics. Jan.2001C.Watters2 What is an internet anyway? 2 or more networks that can communicate.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
WEB SERVER Mark Kimmet Shana Blair. The Project Web Server Application  Receives request for web pages or images from a client browser via the internet.
HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
Web Services. 2 Internet Collection of physically interconnected computers. Messages decomposed into packets. Packets transmitted from source to destination.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
CS 6401 The World Wide Web Outline Background Structure Protocols.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Servlets and JSP
Computer Networks with Internet Technology William Stallings Chapter 04 Modern Applications 4.1 Web Access - HTTP.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
Data and Computer Communications Eighth Edition by William Stallings Lecture slides by Lawrie Brown Chapter 23 – Internet Applications Internet Directory.
Web Protocols: HTTP COMP6017 Topics on Web Services Dr Nicholas Gibbins –
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
INTRODUCTION Dr Mohd Soperi Mohd Zahid Semester /16.
Free Powerpoint Templates Page 1 Free Powerpoint Templates CHAPTER 1 LAB 1.1 Web Server.
HTTP Protocol Amanda Burrows. HTTP Protocol The HTTP protocol is used to send HTML documents through the Internet. The HTTP protocol sends the HTML documents.
HTTP – An overview.
Hypertext Transport Protocol
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
HyperText Transfer Protocol
William Stallings Data and Computer Communications
HTTP Hypertext Transfer Protocol
Presentation transcript:

WebServer A Web server is a program that, using the client/server model and the World Wide Web's Hypertext Transfer Protocol (HTTP), serves the files that form Web pages to Web users (whose computers contain HTTP clients that forward their requests). Every computer on the Internet that contains a Web site must have a Web server program.

So what does a Web server do? It serves static content to a Web browser at a basic level. This means that the Web server receives a request for a Web page such as and maps that Uniform Resource Locator (URL) to a local file on the host server. In this case, the file index.html is somewhere on the host file system. The server then loads this file from disk and serves it out across the network to the user's Web browser. This entire exchange is mediated by the browser and server talking to each other using Hypertext Transfer Protocol (HTTP).

What Is HTTP, and How Does It Work? The Hypertext Transfer Protocol (HTTP) is an application-level protocol. HTTP allows an open-ended set of methods to be used to indicate the purpose of a request. It builds on the discipline of reference provided by the Uniform Resource Identifier (URI), as a location (URL)or name (URN), for indicating the resource on which a method is to be applied. Messages are passed in a format similar to that used by Internet Mail and the Multipurpose Internet Mail Extensions (MIME).

Overall Operation The HTTP protocol is based on a request/response paradigm. A client establishes a connection with a server and sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and possible body content. The server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity metainformation, and possible body content.

Most HTTP communication is initiated by a user agent and consists of a request to be applied to a resource on some origin server. In the simplest case, this may be accomplished via a single connection (v) between the user agent (UA) and the origin server (O). request chain > UA v O < response chain

A more complicated situation occurs when one or more intermediaries are present in the request/response chain. There are three common forms of intermediary: Proxy Gateway Tunnel.

Proxy An intermediary program which acts as both a server and a client for the purpose of making requests on behalf of other clients. Requests are serviced internally or by passing them, with possible translation, on to other servers. A proxy must interpret and, if necessary, rewrite a request message before forwarding it. Proxies are often used as client-side portals through network firewalls and as helper applications for handling requests via protocols not implemented by the user agent.

Gateway A server which acts as an intermediary for some other server. Unlike a proxy, a gateway receives requests as if it were the origin server for the requested resource; the requesting client may not be aware that it is communicating with a gateway. Gateways are often used as server-side portals through network firewalls and as protocol translators for access to resources stored on non-HTTP systems.

Tunnel A tunnel is an intermediary program which is acting as a blind relay between two connections. Once active, a tunnel is not considered a party to the HTTP communication, though the tunnel may have been initiated by an HTTP request. The tunnel ceases to exist when both ends of the relayed connections are closed. Tunnels are used when a portal is necessary and the intermediary cannot, or should not, interpret the relayed communication.

HTTP Message Full-Request = Request-Line ; *( General-Header; | Request-Header ; | Entity-Header ) ; CRLF [ Entity-Body ] ; Full-Response = Status-Line ; *( General-Header ; | Response-Header ; | Entity-Header ) ; CRLF [ Entity-Body ] ;

Request line The Request-Line begins with a method token, followed by the Request-URI and the protocol version, and ending with CRLF GET / index.html HTTP /1.0 /r/n General Header There are a few header fields which have general applicability for both request and response messages General-Header = Date | Pragma

Request Header Request-Header = Authorization | From ; | If-Modified-Since ; | Referer ; | User-Agent For ex: User-Agent: Mozilla/4.72 [en] (X11; I; OSF1 V5.1 alpha)

Entity Header Entity-Header = Allow ; | Content-Encoding ; | Content-Length ; | Content-Type ; | Expires ; | Last-Modified ; | extension-header For ex Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */* Accept-Encoding: gzip Accept-Language: en Accept-Charset: iso ,*,utf-8

Entity Body The entity body (if any) sent with an HTTP request or response is in a format and encoding defined by the Entity-Header fields. Entity-Body = *OCTET An entity body is included with a request message only when the request method calls for one

Status-Line The first line of a Full-Response message is the Status-Line, consisting of the protocol version followed by a numeric status code and its associated textual phrase Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase /r/n e.g., "HTTP/ "

Response Line The response header fields allow the server to pass additional information about the response which cannot be placed in the Status-Line. These header fields give information about the server and about further access to the resource identified by the Request- URI. Ex Location:

Method Definitions GET The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI. If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity in the response and not the source text of the process, unless that text happens to be the output of the process.

HEAD The HEAD method is identical to GET except that the server must not return any Entity-Body in the response. The metainformation contained in the HTTP headers in response to a HEAD request should be identical to the information sent in response to a GET request. This method can be used for obtaining metainformation about the resource identified by the Request-URI without transferring the Entity-Body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification

POST The POST method is used to request that the destination server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. POST is designed to allow a uniform method to cover the following functions: Annotation of existing resources; Posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; Providing a block of data, such as the result of submitting a form, to a data-handling process; Extending a database through an append operation.

How Does a Web Server Serve Content? There is more to a Web server than its function as communications protocol. Ultimately, a Web server serves up content. This content must be identified in a way such that a Web browser can download and display that content in correctly. The primary mechanism for deciding how to display content is the MIME type header. Multipurpose Internet Mail Extension (MIME) types tell a Web browser what sort of document is being sent. Such type identification is not limited to simple graphics or HTML.

How Does a Web Server Accept Connections? Web servers are designed around a certain set of basic goals: Accept network connections from browsers. Retrieve content from disk. Run local CGI programs. Transmit data back to clients. Be as fast as possible

Project Discription In this project, we wrote a basic web server Java using the sockets API. The server can handle multiple request at a time. The browser servers as a client. The program takes as parameters a port number where the server will listen for incoming requests, and a local directory where the public html files reside.

Code Specification The server is able to handle two different kinds of requests: the request of a file, and the request of a directory. If the user requests a file and the file exists in local directory, the file is sent back to the user. Otherwise an HTTP error is sent. If the user requests a directory and the directory exists, an HTML document containing a listing of the directory contentsis sent. Each item is represented as a hyperlink. If the directory does not exist, again, an HTTP error is sent. The server generates an access log, showing every successful transaction. It should contain: the IP address of the client, the date and time of the request, and the name of the file or directory that was requested.