KEMBAR78
CBSR 4003 Web Server Technology | PDF | Hypertext Transfer Protocol | File Transfer Protocol
0% found this document useful (0 votes)
54 views15 pages

CBSR 4003 Web Server Technology

The document discusses various aspects of web servers and HTTP including: - Web server components and how they respond to client requests. - Document organization on web servers using tree structures and file extensions. - Different web server process models including cloning, multithreading, and using helper programs. - The structure of HTTP requests and responses with headers and bodies. - Additional HTTP features like inline images, file transfers using FTP, and persistent connections.

Uploaded by

COCLオスマン
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views15 pages

CBSR 4003 Web Server Technology

The document discusses various aspects of web servers and HTTP including: - Web server components and how they respond to client requests. - Document organization on web servers using tree structures and file extensions. - Different web server process models including cloning, multithreading, and using helper programs. - The structure of HTTP requests and responses with headers and bodies. - Additional HTTP features like inline images, file transfers using FTP, and persistent connections.

Uploaded by

COCLオスマン
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 15

CBSR 4003

WEB SERVER TECHNOLOGY


JAN-2021
E-TUTORIAL 3 & 4

UNIT 2 : WEB SERVERS AND


HTTP
• Web servers components
• Document organization
• Web server process models
• Http- A closer look
• Other HTTP features
• Persistent connections
UNIT 2 : WEB SERVERS AND HTTP
• LEARNING KEY POINTS TO REMEMBER :
• How Web documents can be stored and organized using a variety of document tree structures on the
server?
• How Web servers can operate using different process models? Compare and contrast the different
approaches.
• Examine the structure and meaning of the HTTP messages exchanged between the browser and the
server.
• What are the important characteristics and features of HTTP?

Internet Fact : Till today, there are more than 1.8million active web servers in the
world.
Web Server Components

 Web server = computing platform + Web server


software + documents
 Web server (with unique IP) runs the web software to
respond to requests for resources from Web client.
 Requested requests can be dynamically or statically
generated web documents which are stored,
organized and served from the server’s file system.
 Computing Platform comprises of Operating System
Components of a Web server software, hardware and the network connection.

Criteria for choosing Web server software;


 compatibility with your current operating environment 1. Explain how web server responds to requests for
and hardware platform; resources?
 security features; 2. What is error 404?
 ease of use;
 vendor and technical support;
 availability of upgrades; and
 good performance reviews.
Past exam Q
Web Server Components(cont..)
Establishing a connection between an HTPP client and server
Steps involved;
1. The client must locate the server.
2. The client’s system software initiates TCP
handshake by sending a packet to the server,
requesting a connection.
3. The server’s system software sends a packet back
to the client, agreeing to set up a connection.
4. The client program is connected to the new
network connection.
5. The server program is connected to the new
network connection.
6. The client sends multiple HTTP requests through a
single connection.
7. The server sends HTTP responses back in the same
order as the requests.
8. The server closes the connection.
Popular Web Servers
DOCUMENT ORGANISATION
• Common media type – Images, Audio, Video, Slide presentations, spreadsheets
• MIME types and extensions

Header fields;
Content-Type: text/html
Content-Length: 2294

• Cache - set of Web documents stored on the Web client’s local disk. Fetching documents from a cache is a
lot faster than fetching them from a remote Web server. Caches are useful for improving Web server
performance and response times.
• Document Organisation concept;
• tree structure (hierarchy), example : /BOOKS/AUTHORS/LU_XUN.HTML
• relative name, example ./LU_XUN.HTML (referencing the docs using hyperlinks)
• ‘mirrored’ or replicated document tree
Web server process models

• Web server is designed in a way that it can handle more than 1 task at a time, in parallel, which is also known as
multiprocessing.
• Three process models that allow web server to multiprocess;
• Cloning a copy of the httpd program for each request (process-based)
• Multithreading the httpd program (thread-based)
• Spreading the work among several helper program (hybrid)

• Unix using non-threaded, pre-forking parent-child process model where a single parent process launches multiple child
processes which listen for connections and serve them when they arrive.
• Windows using multithread process model where a single parent launches a single child process which in turn creates threads
to handle requests.

Which process model is used by your localhost Apache


Web server?
Advantages & Disadvantages of Web Server Process Models
Web Browser Hidden Capabilities - Inline Images

• Inline images – images mixed with texts


• How Web browser handles inline images
Command to start the web server
% httpd -f $(apache_rootdir)/conf/httpd.conf
Web browser send HTTP request to retrieve abc_home.html
http://localhost/abc_home.html
Web browser send HTTP request to retrieve abc_logo.gif
img src=”abc_logo.gif”
Web browser send HTTP request to retrieve 10050.gif, 10060.gif and so on till it complete requesting for all inline
images.
img src=”10050.gif” (e.g., the book cover for product 10050)
img src=”10060.gif” (e.g., the book cover for product 10060)
… and so on.
Web Browser Hidden Capabilities - File Transfer Protocol

• FTP (file transfer protocol) is used to communicate and transfer files between computers on a
TCP/IP (transmission control protocol/internet protocol) network.
• FTP connection needs two parties to establish and communicate on the network. To do that, users
need to have permission by providing credentials to the FTP server. Some public FTP servers
may not require credentials to access their files. The practice is common in a so-called
anonymous FTP.
• Three approaches to establish an FTP connection;
• Using Command-line FTP, such as using Command prompt for Windows or Terminal in Mac/Linux.
• Using Web browser to communicate with the FTP server
• Using FTP client - Provides more freedom compared to the command line and web browser, It allows
users to transfer a large file and use the synchronizing utility.
HTTP - A CLOSER LOOK

• All Web browsers and Web server software must implement a core set of features from the HTTP
protocol. The HTTP/1.1 protocol specification is very large and contains many optional features.
In practice, no web browser or web server implements the full, complete HTTP protocol
specification.
• Basic structure of an HTTP message, it contains header, in some cases in got separated by a
blank line and created a new section for the body with <html> tag.
HTTP - A CLOSER LOOK (cont..)
HTTP Request HTTP Responses
1. Start line containing the requested resource, the HTTP method 1. Start line indicating the status (e.g., success or failure) of the
and version (required) [HEADER] request (required);
2. Request header containing the domain name the request is sent 2. Response headers containing metainformation about the Web
to (required); [HEADER] server, its configuration and the methods that it supports. This
3. Request headers containing metainformation about the could also request authorization information or tell the client to
requesting browser and its capabilities (optional); [HEADER] try resending the request at a later time (optional);
4. Entity headers containing metainformation about the contents 3. Entity headers containing metainformation about the contents
of the entity body or about the requested resource (optional); of the entity body, such as encoding schemes, length, type, and
[HEADER] origin (optional); and
5. Entity body containing data sent to the server (included only 4. Entity body containing the resource sent back by the server
when the request method is POST or PUT). [BODY] (optional).

Example Example
GET /products/books/19015.html HTTP/1.1 HTTP/1.1 200 OK ………..(STATUS LINE)
Host: www.abcbooks.com.hk Date: Mon, 06 Dec 1999 20:54:26 GMT
[blank line] Server: Apache/1.3.6 (Unix)
Last-Modified: Fri, 04 Oct 1996 14:06:11 GMT
Accept-Ranges: bytes
Content-length: 327
Connection: close
Content-type: text/html
GET /products/books/10050.html HTTP/1.1
… followed by the document.
OTHER HTTP FEATURES

• HTTP feature enhancements which have been added;


• Virtual Hosts – permits single Web server to manage multiple server names such IP based virtual hosting and name-based virtual
hosting (multiple names share same IP).

• Content Negotiation - the process of a Web server selecting and delivering the version of a document that best matches the Web
browser’s display preferences and capabilities. It is achieved by exchanging request header fields and entity header fields within
HTTP messages.
• Persistent Connections -
• To address the issue - opening and closing multiple TCP connections associated with serving a single document can lead to network
traffic congestion and considerable overhead on CPU time, bandwidth, and memory.
• The browser opens a connection and sends several requests at a time (called pipelining). Then, the Web server sends responses back
in the same order as the requests. All connections are kept alive unless the client states otherwise, with the following header:
Connection: close
• If this header is sent along with the request, then the server will close the connection following the response, and the client will not be
able to use this connection for further requests. The Connection: close header should be used if the Web client does not support
persistent connections, or if it knows that this is the last request to be sent out on this connection. The server may also close an idle
connection after a suitable timeout period.
THE END

You might also like