Dynamic Web Site Development - Introduction To Web Technology
Dynamic Web Site Development - Introduction To Web Technology
The Internet
The Internet began in the late 1970's as a research project of the
United States Department of Defense (D.O.D). The US military were
experimenting with wide-area networks to see if it was possible to
link computers across the US so that they could continue
communicating with each other in the advent of a nuclear war. This
was desirable, as most of the early warning systems and defense
systems were becoming computerized in the 1970s.
Page 1/19
Dynamic Web Site Development – Introduction to Web Technology
Page 2/19
Dynamic Web Site Development – Introduction to Web Technology
Protocols
There is no point in connecting heterogenous computers if they
cannot ex-change information. The diffculty of interconnecting
computers is they do not all speak the same language.
The one thing that all parts of the Internet have in common is the
protocol they use to send information from one machine to another.
The protocol used is TCP/IP (Transfer Control Protocol/Internet
Protocol). This language (and grammar) species how two computers
can send each other, how they introduce themselves, and how they
conduct a conversation.
Using TCP/IP any computer can contact any other computer on the
Internet and exchange data with it provided that
1. it knows the remote computer's address, and
2. the remote computer is willing to talk.
The TCP/IP is a low level protocol, it is used to establish the link, set
up the line of communication and ensure the data arrives at the
destination. TCP/IP has no knowledge of the contents of the data or
of high level structures. To TCP/IP all data is a linear stream of 8-bit
numbers. To use an analogy, the telephone company establishes the
line of communication when you dial a telephone number and
ensures it remains open and all the data (your voice) arrives at the
destination. It is up to you, not the telephone company, to ensure
that the data you send is understandable at the other end, that is,
you both speak the same language! The TCP/IP will maintain the link
and ensure the data arrives intact, something else must ensure that
the data has meaning.
The Network News Transfer Protocol (NNTP) is used for Usenet, the
Internet news system. This was designed as a communal bulletin
board, where anyone could post information, state their opinions on
any topic, and generally have their say.
Page 4/19
Dynamic Web Site Development – Introduction to Web Technology
IP Addresses
The telephone company assigns a unique telephone number to
every telephone. There are no two telephone numbers that are the
same in the world (remember a full telephone number incorporates
the country code and area code). The TCP/IP is the same, every
machine on the Internet is assigned a unique number, the IP
address. IP addresses are 32-bit numbers that are usually written
out as four 8-bit numbers, separated by dots. There are
approximately 4 billion addresses available, which may seem
sufficient for sometime into the future, unfortunately this is not the
case. There are a number of reasons for this,
_ there are reserved addresses for special purposes, such as
multicasting.
_ more importantly addresses are issued in contiguous blocks, not
individually.
Page 5/19
Dynamic Web Site Development – Introduction to Web Technology
Page 6/19
Dynamic Web Site Development – Introduction to Web Technology
Domain Names
The IP address is computer friendly but not people friendly. It is
difficult to remember and hard to type. For this reason, as well as an
IP address computers are also given a people friendly name. The
names are assigned using the distributed hierarchical lookup system
known as Domain Name System (DNS). In the DNS each machine
has a unique name consisting of multiple parts separated by dots
(Not unlike IP addresses, except there is no limit to the number of
parts).
For a complete list of country codes refer to the ISO 3166 country
code list in the course resources directory.
Code Country
au Australia
uk United Kingdom
ch Switzerland
jp Japan
de Germany
Therefore you will find domain names that do not follow the
convention. An important feature of the DNS is that a single
machine can have one or more aliases assigned to it in addition to
its true name. This feature is widely used to give descriptive names
to server machines.
Page 8/19
Dynamic Web Site Development – Introduction to Web Technology
Port Numbers
When two programs on different computers wish to
communicate with each other it isn't enough that they know each
others IP addresses. They need a mechanism to be able to
rendezvous. As a single machine runs multiple programs and
supplies multiple services, an external program needs a mechanism
to be able to specify the program it wishes to communicate with on
a remote machine.
Port Service
23 Telnet
80 HTTP
119 NNTP
21 FTP
Page 9/19
Dynamic Web Site Development – Introduction to Web Technology
25 SMTP
Server
When the server starts up it signals the operating system that it
is willing to accept connections on a given port. It then waits for the
connections. The server starts running first.
Client
When a client needs to send information to the server or
retrieve information from the server it opens a connection to the
known port, and passes information back and forth. When finished
the client closes the connection.
The distinction between client and server rests on who initiates the
connection and who accepts it. Although the server is normally the
information provider this is not always the case. However, it is
generally true that the client interacts with the user, processing
keystrokes and displaying results.
Page 10/19
Dynamic Web Site Development – Introduction to Web Technology
The user interacts with the server through the client, never directly.
HELP
What happens?
To exit type QUIT
An alternative address to try if the one above fails is
romulus.sci.usq.edu.au or your ISP's mail server.
Page 11/19
Dynamic Web Site Development – Introduction to Web Technology
Page 12/19
Dynamic Web Site Development – Introduction to Web Technology
The turning point for the Web occurred in 1993, when the U.S.
National
Center for Supercomputing Applications (NCSA) released it's web
browser Mosaic. This browser used icons, pop up menus, rendered
bit mapped text, displayed images, used color links to display
hypertext links and provided support for sounds, animations, and
other types of multimedia.
http://www.sci.usq.edu.au:80/courses/CSC2406/index.html
protocol host port path resource
The first part of the URL (delimited by the colon) specifies the
communication protocol, eg. http, ftp, news, mailto, gopher, telnet.
If the protocol is omitted then a web browser assumes http. The
Page 13/19
Dynamic Web Site Development – Introduction to Web Technology
second part, beginning with the double slash and ending with the
single slash is the name of the host machine on which the resource
resides. An optional port number can be specified but it is only
required if the remote server has been configured to use a
nonstandard port. The rest of the URL is the path to the resource.
The characters =;/#?:%&+ and the space character are also legal
but have special meanings
(eg. the : is used to delimiter the port number). ALL other
characters, symbols etc. are illegal.
For example, a carriage return can be placed into a URL using the
escape sequence %0D, a space is escaped to %20, and the percent
sign by %25. The character codes used in a URL are the ASCII
character codes (see the ASCII character codes in the course
resources directory) and the 8-bit superset, ISO Latin-1 (see the
Latin-1 page in the course resources directory).
URL Addressing
There are two types of URLs, absolute and relative. An absolute URL
contains all the information necessary to locate the resource. For
instance the following are absolute URLs
http://www.sci.usq.edu.au/courses/CSC2406/index.html
Page 14/19
Dynamic Web Site Development – Introduction to Web Technology
www.sci.usq.edu.au/courses/CSC2406/closed/Changes.html
www.usq.edu.au/library/
Though the last two did not specify the protocol the web client will
assume http.
In the above examples the machine address, the path and the
resource were all specified. Given this information you know exactly
where the resource is located, or more importantly the web browser
does. What about the following valid URLs
/courses/index.html
../closed/Changes.html
appendix/ascii.html
How does the web browser know where to look for the resources
since the addresses are incomplete? The browser must assume the
URL is relative to the current resource to fill in the blanks. The
current resource is the resource that contains the relative URLs. For
example, if you download the HTML page
http://www.sci.usq.edu.au/courses/CSC2406/sb/index.html and it
contains the relative URLs above, they are interpreted as having the
following absolute URLs:
http://www.sci.usq.edu.au/courses/index.html
http://www.sci.usq.edu.au/courses/CSC2406/closed/Changes.html
http://www.sci.usq.edu.au/courses/CSC2406/sb/appendix/ascii.html
HTTP
Page 15/19
Dynamic Web Site Development – Introduction to Web Technology
Page 16/19
Dynamic Web Site Development – Introduction to Web Technology
Page 17/19
Dynamic Web Site Development – Introduction to Web Technology
Before moving ahead, let's get a better idea of how HTTP headers
work by viewing a webpage without a browser, so we can see the
converation in is entirety.
Start by opening a command prompt (in windows, go to Start-
>Run, type cmd, and click "OK"...if you're using linux you
probably already know). At the prompt, type:
telnet expertsrt.com 80
and press Enter. This will connect you to expertsrt.com on port 80.
Next, copy and paste just the text below:
GET / HTTP/1.1
Host: expertsrt.com
Don't worry if when you type or paste the text, it does not show up
in your command window and all you see is the cursor -- it is indeed
being sent to the server. The first line says you are using the GET
request method to get the resource / (i.e. the file in the base
directory of the host), and that you are using HTTP version 1.1. The
second tells the server which host you want to connect to. When
you finish typing 'expertsrt.com', hit Enter twice (and twice only).
You should almost immediately get a response that looks like:
Page 18/19
Dynamic Web Site Development – Introduction to Web Technology
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a
href="http://www.expertsrt.com/"> here</a>.</p>
</body></html>
Whoops! Looks like we requested a resource that wasn't there; it's
been permanently moved to the new Location
http://www.expertsrt.com. If you were using a browser, you'd only
see the HTML — everything before the first blank line is the headers.
In fact, modern browsers are even smarter than that — when they
see the Location header on the third line, they automatically go
there so you don't have to type in a new URL. Let's go to the new
URL. By this point, you probably got disconnected while you were
reading this. If so, just press your up arrow on the keyboard to get
your telnet command back, and press enter to reconnect. If you're
still connected, you can just go ahead and type the following:
GET / HTTP/1.1
Host: www.expertsrt.com
and press Enter twice after the second line. You'll get another similar
response telling you that the page is actually at
http://www.expertsrt.com/index.php. The server is particular, isn't it?
;-) Repeat the above, but this time type
Notice that the name of the file we want is in the first line. This time
we get flooded with text: the HTML from ERT's homepage. The
headers look like
HTTP/1.1 200 OK
Date: Wed, 08 Feb 2006 08:20:07 GMT
Server: Apache/2.0.54 (Debian GNU/Linux)
mod_auth_pgsql/2.0.2b1 mod_ssl/2.0.54 OpenSSL/0.9.7e
X-Powered-By: PHP/4.4.0
Transfer-Encoding: chunked
Content-Type: text/html
Page 19/19