Chapter 1 deck Chapter 2 deck Chapter 3 deck Chapter 4 deck Chapter 5 deck Chapter 6 deck Chapter 7 deck Chapter 8 deck Chapter 9 deck Chapter 10 deck Chapter 11 deck Chapter 12 deck Chapter 13 deck Chapter 14 deck

Chapter 8: Web Browser & Server

34 slides · use ←/→ or Space to navigate, F for fullscreen.

Reading view

Jump to a lesson deck: Introduction to Web Browsers & Architecture Evolution & Comparison of Web Browsers Extending the Browser Introduction to Web Servers General Server Characteristics HTTP Request Types & Caching Accessing Web Servers Apache & XAMPP System Architecture: 1, 2 & 3 Tiers

Chapter 8: Web Browser & Server
Fullscreen for presentation · Print / PDF for a handout
1 / 34
Chapter 8

Chapter 8: Web Browser & Server

How browsers work and how web servers deliver content — architecture, HTTP requests, XAMPP, and multi-tier system architecture.

Lesson

Introduction to Web Browsers & Architecture

What a web browser is and the basic components of its architecture.

Introduction to Web Browsers & Architecture

Introduction

  • A web browser is a software application for retrieving, presenting and traversing information on the World Wide Web.
  • An information resource is identified by a Uniform Resource Identifier (URI) and may be a web page, image, video or other piece of content.
  • Examples: Google Chrome, Safari, Internet Explorer, Mozilla Firefox, Opera, Netscape Communicator.
Introduction to Web Browsers & Architecture

Web Browser Architecture

Many commercial browsers interpret and display web documents. Their capabilities and structure vary depending on implementation, but all must have the most basic components:

  • Controller
  • Client programs
  • Interpreters
Controller
  ├─ Client programs : HTTP Client, FTP Client, SMTP Client
  ├─ Interpreters    : HTML Interpreter, Optional Interpreter
  └─ Driver program / Screen Input-Output + Graphical User Interface
Introduction to Web Browsers & Architecture

Roles of the Components

  • Controller — works as a control unit (like the CPU). It takes input from the keyboard or mouse, interprets it, and makes other services work on the basis of the input it receives.
  • Interpreter — receives information from the controller and executes the instructions line by line.
  • Client program — describes the specific protocol that will be used to access a service. When a link is selected, the controller extracts the scheme from the URL; this determines which client (HTTP, FTP, etc.) will be used to fetch the document.

The browser fetches the document and, depending on the document type (HTML, XML, etc.), calls the appropriate interpreter to render and display it.

Lesson

Evolution & Comparison of Web Browsers

The browser timeline from WorldWideWeb to Chrome, and how browsers are compared.

Evolution & Comparison of Web Browsers

Evolution of Web Browsers

YearBrowser
1990WorldWideWeb (Nexus)
1993Mosaic
1994Netscape
1995Internet Explorer
1996Opera
1998 / 2002Mozilla
2003Safari
2004Firefox 1.0
2006Internet Explorer 7
2008Google Chrome

Highlights

  • WorldWideWeb (1990) — the first graphical web browser and WYSIWYG HTML editor, developed by Tim Berners-Lee, inventor of the web. Renamed to Nexus to avoid confusion with the system.
  • Mosaic (1993) — credited with popularising the internet and introducing the web to the public; roughly 4 million users.
  • Netscape (1994) — the first commercial browser (Netscape Navigator) by Marc Andreessen; reached 90% of all web use at its peak.
  • Internet Explorer (1995) — Microsoft's browser, starting the first browser war; peak of about 95% usage during 2002–2003.
  • Opera (1996) — offered to the public by Telenor; later ported to mobile devices. Never achieved widespread desktop use.
  • Mozilla (1998 / 2002) — Netscape released its source code; the Mozilla project built from scratch (initially named Phoenix).
  • Safari (2003) — Apple's browser, introducing the WebKit layout engine, later adopted by many mobile devices.
  • Firefox 1.0 (2004) — started the second browser war as Internet Explorer's share slipped.
  • Internet Explorer 7 (2006) — adopted features from its open-source competition, such as tabbed browsing and anti-phishing protection.
  • Google Chrome (2008) — lightweight, fast and stable; a strong new competitor.
Evolution & Comparison of Web Browsers

Comparison of Web Browsers

Browsers are compared on features such as cloud sync, private browsing, full-screen mode, side tabs, custom extensions, platform support, JavaScript engine, and whether they are open source.

BrowserJavaScript engineOpen source
ChromeV8No (based on Chromium)
FirefoxSpiderMonkey / TraceMonkeyYes
SafariWebKit / NitroNo
EdgeChakra / V8No
Lesson

Extending the Browser

Helper applications, plugins/add-ons and Java applets.

Extending the Browser

Extending the Browser

A browser designer cannot sustain the development effort required to support every possible document format, and owners of proprietary formats may not want to expose their encoding. To accommodate this, browsers incorporate features that allow new functionality to be added without recompilation — such applications are called extensible.

  • Helper applications
  • Plugins / add-ons
  • Java applets
Extending the Browser

Helper Applications

  • An external viewer program launched to display content retrieved using a web browser.
  • Examples: Adobe Reader, Windows Media Player, QuickTime Player.
  • Unlike a plugin (whose full code is included in the browser), a small line is added to the browser code telling it to open a certain helper application when it encounters a certain file format.
  • This provides a simple mechanism to extend browser functionality by invoking external applications (e.g. Adobe Reader) to display documents.
Extending the Browser

Plugins / Add-ons

  • A plugin is software that manages internet content a browser is not designed to process.
  • Because plugins run in the same address space as the browser, they must be carefully constructed — a faulty plugin could corrupt the browser's internal data structures.
  • For some file types you may need a special plugin, also known as an add-on or extension.
Extending the Browser

Java Applets

  • An applet is a program written in Java, a general-purpose programming language.
  • The applet code is downloaded from a web server and executed within the browser.
  • To run an applet you need to install a Java Virtual Machine.
  • Applets provide interactive features that cannot be provided by HTML alone, such as online game collections.
<html>
<head>
  <title>World</title>
</head>
<body>
  <applet code="HelloWorld.class" width=400 height=80>
  </applet>
</body>
</html>
Lesson

Introduction to Web Servers

What a web server does and the most popular servers.

Introduction to Web Servers

Introduction to Web Server

  • A web server is specialised software that responds to client requests by providing resources.
  • When users enter a URL into a web browser, they request specific documents from a web server.
  • It maps the URL to a file on the server and returns the requested document to the client.
  • It communicates with the client using HTTP — the protocol for transferring requests and files over the internet.
  • Examples: Internet Information Services (IIS), Personal Web Server (PWS), Apache Web Server, Tomcat.
Introduction to Web Servers

Popular Web Servers

Web serverApprox. share
Apache51.4%
Nginx31.4%
Microsoft-IIS11.9%
LiteSpeed1.3%
Google Servers0.6%
Tomcat0.3%

Apache is the most popular web server overall, but nginx dominates in growth. Note that a website may use more than one web server.

Lesson

General Server Characteristics

Document root, server root, virtual hosts and proxy servers.

General Server Characteristics

Document Root

  • Web servers have two separate directories.
  • The document root is the root directory of all servable documents.
  • Example: if the site is www.bloomers.com and the document root is named topdocs, stored in /admin/web, then the document directory is /admin/web/topdocs.
  • If a request URL is http://www.bloomers.com/bulbs/tulips.html, the server searches for /admin/web/topdocs/bulbs/tulips.html.
  • Servers can have virtual document trees — sometimes a different disk, possibly on a different machine, is used after the original disk is filled.
General Server Characteristics

Server Root

The server root is the root directory for all the code that implements the server. It usually contains four items — the server code itself plus three subdirectories:

DirectoryPurpose
confConfiguration information.
logsTo store what has happened.
cgi-binExecutable scripts.
General Server Characteristics

Other Server Services

  • Virtual hosts — multiple sites on the same system.
  • Proxy servers — to serve documents from the document roots of other sites.
  • Support for FTP, Gopher, News and email, in addition to HTTP.
  • Support for database access.
Lesson

HTTP Request Types & Caching

GET vs POST, and how browsers cache responses.

HTTP Request Types & Caching

HTTP Request Types

Also known as request methods. The most popular are get and post, used to retrieve and send client form data to a web server.

GET requestPOST request
Sends form content as part of the URL
Retrieves the appropriate resource from the web server
Limits the query to 1024 characters
Updates the contents of the web server (e.g. posting new messages to a forum)
Has no limit on query length
Not part of the URL and cannot be seen by the user

POST data is sent to a server-side form handler.

HTTP Request Types & Caching

Caching

  • Browsers cache (save on disk) web pages, allowing for quick reloading.
  • They cache responses to GET requests.
  • They do not cache responses to POST requests.
Lesson

Accessing Web Servers

Local vs remote servers, domain names, TLDs, IP addresses and DNS lookups.

Accessing Web Servers

Accessing Web Servers

Requesting documents requires knowing the machine name on which the web server resides — through local or remote web servers, and through a domain name or an IP address.

Local web server

  • Resides on the user's machine.
  • Requests documents by machine name or localhost — the host name that references the local machine.

Remote web server

  • Resides on a different machine.
  • Domain name — represents a group of hosts on the internet; it combines a host name (www) and a top-level domain to form a fully qualified host name.
  • Top-level domain (TLD) — describes the type of organisation that owns the domain name, e.g. .com or .org.
  • Fully qualified host name — a user-friendly way to identify a site on the internet.

IP address and DNS

  • IP address — a unique address for locating computers on the internet.
  • Domain Name Server (DNS) — maintains a database of host names and corresponding IP addresses. It translates a fully qualified host name to an IP address — known as a DNS lookup.
Lesson

Apache & XAMPP

The Apache web server and the XAMPP local development stack.

Apache & XAMPP

Apache Web Server

  • Maintained by the Apache Software Foundation.
  • Currently the most popular web server.
  • Stable, efficient and portable.

On Windows you can start it via Start → Programs → Apache httpd Server → Control Apache Server → Start.

Apache & XAMPP

What is XAMPP?

XAMPP is a simple and lightweight Apache distribution that makes it extremely easy for developers to create a local web server for testing purposes.

LetterStands for
XCross-platform
AApache
MMySQL
PPHP
PPerl

What is included in XAMPP?

ComponentDescription
ApacheThe actual web server application that possesses and delivers web content to computers.
MySQLThe world's most popular open-source database management system.
PHPThe most popular server-side scripting language; works perfectly with MySQL.
PerlA high-level dynamic programming language used extensively in network programming and system administration.

Other modules

OpenSSL, phpMyAdmin, MediaWiki, Joomla, WordPress, FileZilla FTP Server, Mercury Mail Transport System, Tomcat, Strawberry Perl, Webalizer and the XAMPP Control Panel.

Lesson

System Architecture: 1, 2 & 3 Tiers

Client-server architecture, tiers, and why 3-tier solves the problems of 2-tier.

System Architecture: 1, 2 & 3 Tiers

Client-Server Architecture

Client tasksServer tasks
Provide a way for users to submit queries
Run applications that use the results of queries
Display results of queries
Implement a data manipulation language that can directly access and update the database

A two-tier system has clients that are connected directly to the server.

System Architecture: 1, 2 & 3 Tiers

Tiers

  • 1-tier — client computers and a file server.
  • 2-tier — client tier + database tier (clients connect directly to the server).
  • 3-tier — client tier + business logic (middle) tier + database (information) tier.
System Architecture: 1, 2 & 3 Tiers

Problems with a Two-Tier System

  • Performance degrades as the number of users increases.
  • Scalability — supports only a limited number of users; simultaneous client requests require separate connections and CPU/memory, so performance degrades rapidly.
  • Lack of security — clients have direct access to the database.
  • Reusability — clients are mostly monolithic, so reuse is not possible.
System Architecture: 1, 2 & 3 Tiers

Solutions with a 3-Tier Implementation

  • Improved scalability — distributed application servers mean a separate connection from each client is not required; connections from a few application servers are sufficient.
  • Improved security — the client does not access the database directly.
  • Reusability — greater with service implementation.

Conclusion: the problems in a two-tier architecture can be handled using a three-tier implementation.

System Architecture: 1, 2 & 3 Tiers

The Three Tiers

TierRole
Client tierThe top tier. The application's user interface; users interact with the application through it, it makes requests to and retrieves data from the information tier, and displays data to the user.
Information tierThe data (bottom) tier. Maintains data for the application, stored in a relational database management system.
Middle tierImplements business logic and presentation logic; acts as intermediary between application clients and application data.

Middle tier responsibilities

  • Controller logic — processes client requests from the top tier and retrieves data from the database.
  • Presentation logic — processes data from the information tier and presents content to the client.
  • Business logic — enforces business rules, dictates how clients can access application data and how applications process data, and ensures data validity before updating the database.