You are on page 1of 25

Web

programming
Chapter one
World Wide Web
Introduction
 The Internet – a network of networks
 An infrastructure (connectivity among a large number
of machines world wide)
 Some of internet requirements
 Computer with modem
 Internet account with ISP.
 Web browser

ASU/CCI/Department of Computer Science


2
Applications of Internet
 Some of Internet applications are:
 E-mail
 www
 File transfer (FTP)
 Remote login
 E-commerce
 Instant messaging (chat)
 Mailing lists
 …

ASU/CCI/Department of Computer Science


3
Cont’d…
File Transfer Protocol (FTP)
 Used for exchanging files from one place to another.
 Files like video, audio, text data can be uploaded and
downloaded Ftp.
E-commerce:
 Means to carry out financial and business dealings over
internet.
 People can buy and sell products on internet and payment
can be made using Credit Card numbers.
 Common applications include:
 Online banking
 Online shopping
 Electronic tickets …

ASU/CCI/Department of Computer Science


4
Cont’d…
Chatting and Instant Messaging:
 Allow users on the Internet to communicate with one
another by typing messages. Example:
 Yahoo,
 Messenger,
 IRC…

World Wide Web


 Berners-Lee created WWW by bringing together three
technologies that were already in development at the time:
 Markup Language – a system of instructions and
formatting codes embedded in text
ASU/CCI/Department of Computer Science
5
Cont’d…

 Hypertext – a means of embedding links to other


documents, images, and other elements in a document.

 Internet – a global network of computers where clients


request service and servers provide services
 WWW pages are connected to one another using hypertext that
allows you to move from one page to any other page, and to
graphics, multimedia files, as well as any Internet resources.

ASU/CCI/Department of Computer Science


6
Cont’d…

ASU/CCI/Department of Computer Science


7
WWW vs Website
www (world wide web)
• A collection of websites
• The web pages in a website are connected to one another
using hyperlinks.
• It use a protocol called HTTP.
website
• A collection of resources:
• Web pages (static / dynamic)
• Media files (images, animations, sound, …)
• Style files (CSS)
• Documents (pdf, doc, txt, rtf, …)
ASU/CCI/Department of Computer Science
8
Website
 Has a globally unique name. E.g. www.asu.edu.et
 Stored on machines called web servers
 A web page: - a document with a mark-up language called HTML
 The basic unit of information storage on the www.
 A Webpage is categorized into two types.
 Static webpages:-Web pages stored on the server in the format that is sent to
a client web browser.
 Information is no more required to be modified.
 It is primarily coded in HTML.
 Easy to create.
 Dynamic webpages:-It shows different information at different point of
time.
 Information can be changed depending on the time, viewer authority,
viewers language and other conditions.
ASU/CCI/Department of Computer Science
9
How does the www work
 Websites (with unique names) are stored on web servers
 Users access these websites via the Internet using
software called a web browser.
 A user sends requests for resources from a server with
the help of a user agent (browser)
 The server sends the requested resource to the user agent
 The user agent renders the resource for the user to view.
Home Page
 It is the starting point of a web site.
 It provides information about the site’s purpose and content

ASU/CCI/Department of Computer Science 10


Web hosting:

 A service that allows you to post and store a website onto the
Internet.
 It is like the home of your website where it actually lives.
 Web hosting makes the files that comprise a website (code,
images, etc.) available for viewing online.
 Every website you’ve ever visited is hosted on a server.
 HTML: It is the fundamental language to design web pages.
 Webmaster: A person who develops and maintains a website.
 ISP:A company that provides a connection between the user’s
computer and the Internet.

ASU/CCI/Department of Computer Science 11


Software Involved
 Software involved are:
At the server
 Web server software : listens for incoming requests for resources
from clients and serves the requests
 Apache - open source
 IIS (Internet Information Services) – Microsoft
 Squid
 …

ASU/CCI/Department of Computer Science 12


Cont’d…
At the client
 Web browser: an application software that acts as an
interface between the user and the Internet.
 sends/receives requests/responses to/from web servers
on behalf of the client and renders content as necessary.
 It has the capability to understand HTML.
 It can display text and graphics.
 Microsoft Internet Explorer
 Mozilla
 Firefox
 Opera
 Safari
 …

ASU/CCI/Department of Computer Science 13


Communication Protocol
 HTTP (HyperText Transfer Protocol)
• Client (web browser) and Server (web server) communicate via the
HTTP to exchange request/response messages
• It allows computers to communicate with each other.
 HTTP is the standard protocol for transferring web content.
 It is the foundation of data communication for the World Wide Web.
 HTTP has been in use by the World Wide Web global information
initiative since 1990.
 The first version of HTTP, referred to as HTTP/0.9, was a simple
protocol for raw data transfer across the Internet.
 The web is governed by the w3c (world wide web consortium)
(www.w3.org)
ASU/CCI/Department of Computer Science 14
How websites are uniquely named
DNS (Domain Name System)
 It is the address of website that people type in the browser URL
bar to visit your website.
 Resolves a human friendly name (eg www.google.com) to a
machine friendly IP address (eg 64.233.187.99)
 For this purpose, DNS servers store a table containing name-IP
(among other things) pairs and do a look-up when requested
 A DNS server may communicate with other server to resolve a
given name.
 There are about 12 root DNS servers (
http://www.root-servers.org/)

ASU/CCI/Department of Computer Science 15


Cont’d…

DNS name structure


 It is used to convert IP address to URL and vice versa.
 Hierarchical in nature (eg. cs.asu.edu.et) :-cs is under asu (a subdomain of
asu), asu is under edu, edu is under et.
 The highest level is the last component of the DNS address. Labels separated
by dot. Labels can be up to 63 characters long and are case insensitive
 A maximum of 255 characters is allowed in total The last (highest) labels of a
DNS name can be:
 Three letter code top level domains (TLDs): indicating the type of
organization
 com, edu, gov, net, org, biz, …
 Two letter country codes (CCTLDs): indicating the country
 et, us, za, uk, tv, …
ASU/CCI/Department of Computer Science 16
Cont’d…

 At the top of the DNS hierarchy are 13 root name servers, which
contain name server information for all of the generic top-level
domains
 Top level domains are.com and .org as well as country-specific DNS
addresses such as .uk or .nz.
 The name servers for each of these top-level domains contains name
server information for domains within that top-level domain.
 So the name server for .com will contain information about
microsoft.com but will not contain information about microsoft.co.uk.
 Your name server will have to contact the server that contains the
information for .co.uk.
ASU/CCI/Department of Computer Science 17
Introduction (cont’d)

ASU/CCI/Department of Computer Science 18


Domain name registration 
 A domain name is a unique name for a web site, like
http://www.w3schools.com.
 Domain names must be registered to be used for websites.
 When domain names are registered, they are added to a large domain name
register.
 In addition, information about the web site, including the IP address, is
stored on a DNS server.
 Getting a domain name involves registering the name you want with an
organization called ICANN (Internet Corporation for Assigned Names and
Numbers) through a domain name registrar.
 For example, if you choose a name like "example.com", you will have to go
to a registrar, pay a registration fee and get registered.
 That will give you the right to the name for a year, and you will have to
renew it annually.
ASU/CCI/Department of Computer Science 19
Cont’d…
 Domain registration information is maintained by the domain name
registries, which contract with domain registrars to provide registration
services to the public.

 An end user selects a registrar to provide the registration service, and


that registrar becomes the designated registrar for the domain chosen
by the user.

 Only the designated registrar may modify or delete information about


domain names in a central registry database.

 A domain name registrar is an organization that manages the


reservation of Internet domain names.
ASU/CCI/Department of Computer Science 20
URI, URL and URN

 URI stands for Uniform Resource Identifier, which is used to identify


resource on the web.
 A URI identifies a resource either by location, or a name, or both.
 Most of use URIs that defines a location to a resource.
 URIs can be classified as Uniform Resource Locators (URLs), as
Uniform Resource names (URNs).
 A uniform resource name (URN) functions like a person's name, while
a uniform resource locator (URL) resembles that person's street
address.
 In other words, the URN defines an item's identity, while the URL
provides a method to find it.
ASU/CCI/Department of Computer Science 21
Cont’d…
 The World Wide Web can be conceived as a large group of resources
placed in different computers all around the world.
 These resources can be found and linked through URIs.
 URI identifies resources by assigning them addresses in a given
network.

ASU/CCI/Department of Computer Science 22


Cont’d…

 URL (Uniform Resource Locator)


 The unique address of a resource on the web.

 Consists multiple parts including protocol and domain name.


 An alternative to the IP address assigned to a server is a textual
name called URL.
 Format:
 <protocol>://<host>[:<port>][<path>][?<query>]
 E.g. http://www.somedomain.com/search.php?q=dns&lang=en

ASU/CCI/Department of Computer Science 23


Cont’d…
 Protocol – identifies the type of protocol to be used for
communication
http, ftp, mailto, …
 Host – identifies the machine on which the requested
resource is stored
Domain names (eg. www.google.com) and IP address
 Port – identifies the port number of the web server software
on the web server machine.
 Usually not visible in URLs but necessary.
Default port for http: 80
 Path – identifies the name and path of the resource on the
server.
 query – specifies parameters.
has the form: ?var_name1=value1&var_name2=value2&…

ASU/CCI/Department of Computer Science 24


You might also like