Web Application Resources - gozips.uakron.edu
Download
Report
Transcript Web Application Resources - gozips.uakron.edu
2440: 141
Web Site Administration
Web Application Resources
Instructor: Enoch E. Damson
Client/Server Basics
The client/server model generally has clients and servers, and
business/application logic (rules)
Client – hardware or software used to communicate with a data
provider (server)
Normally, one user uses a specific client at a time
Server – a computer capable of providing data to many clients at the
same time
The term server can mean:
the physical computer or piece of hardware
the actual server software or daemon running on that machine
Daemon – a program that offers a service to other programs, usually over a
network
Application/business logic – rules written in a programming language
to help the communication between clients and the server
Web Application Resources
2
Network Connections and Ports
Computers connected to the Internet typically
communicate using TCP/IP (Transmission Control
Protocol and the Internet Protocol)
TCP/IP – allows computers to communicate at a network-
level using IP (Internet Protocol) addresses
TCP (Transmission Control Protocol) – invented by Robert Kahn
IP (Internet Protocol) – created by Dr. Vinton Cert together with
Robert Kahn
Web Application Resources
3
Network Connections and Ports…
IP Address – a unique identifier assigned to each
computer on the Internet
Port number – a unique identifier that indicates each
service running on a computer
Most services have standard port numbers
Some standard ports numbers are:
ftp (20,21), telnet (23), smtp (25), http (80)
Web Application Resources
4
Web Servers
Service client requests for documents
The European Lab for Particle Physics (CERN) produced one of
the first Web servers
The World Wide Web Consortium (W3C) took over the
development of the CERN HTTPD (W3C HTTPD)
The National Center for Supercomputing Applications (NCSA)
also created an HTTP server which quickly became popular
between 1993 and 1995
The Apache server (based on the NCSA implementation) has
become very popular
Web Application Resources
5
Web Browsers
Used as a client to retrieve and display information
from Web servers
Earlier Web browsers were text-based
E.g. gopher, WAIS, telnet, FTP
NCSA Mosaic was the first real HTML browser that
was developed in 1993
There are several browsers on the market now
Web Application Resources
6
Electronic Publishing
The two main types of files in Web publishing are:
ASCII Text Files – uses numeric values (0 – 127) to represent
letters, numbers, and other characters
Each byte of the file represents a specific character
Binary Files – contain images, sounds, compressed ASCII
text, etc
Web Application Resources
7
Images
There are several file formats available for storing graphics and
images
Web browsers support just a few image format
The most common type of formats are:
GIF (Graphic Interchange Format) – mostly used for graphics (like clip
arts logos, icons, etc) requiring fewer colors because it displays only 256
colors
JPEG/JPG (Joint Photographic Expert Group) – mostly used for
photographs and images covering a wide spectrum of color because it
uses the full 16.7 million colors
PNG (Portable Network Graphic) – offer millions of colors, lossless
compression, and other features that make them a good alternative to
GIF images in most cases
Web Application Resources
8
Audio
Embedded in Web applications to play automatically,
or used as links to be played when a user clicks on a
link to the sound file
Some of the common sound files include:
WAV – originated on Windows-based machines
AIFF – originated on Macintosh
AU – originated on Sun Microsystems workstations (UNIX)
Web Application Resources
9
Multipurpose Internet Mail Extensions
(MIME) Types
Set of rules that allow multimedia documents to be
exchanged among many different computer systems
Originally designed for sending email attachments
and incorporated into http
Both the Web server and the Web browser must have
a MIME types database
Mime type database – used to identify the file extension
and determine how the file must be sent
Web Application Resources
10
The Hypertext Transfer Protocol (HTTP)
Provides a standard way of communication and information
exchange between the Web browsers and Web servers
Expects the client to initiate a request and the server to
respond
Each request and response has three parts:
Request/Response line – contains a request method, the document
location, and the protocol version
Header section – series of lines with http headers that are used to pass
other information about the request and the client to the server
Entity body – contains other data to be passed to the server
Web Application Resources
11
HTTP Request/Response Example
Client Request
Server Response
GET /hello.html HTTP/1.1
HTTP/1.1 200 OK
Host: test.com
User-Agent: Morzilla/4.5
Date: Wed, 06 Sept 2006 13:56:05 GMT
Last-Modified: Wed, 06 Sept 2006 13:50:23 GMT
Server: Apache/2.0.52
Connection: close
Content-Length: 25
Content-Type: text/html
<html>
Hello world!
</html>
Web Application Resources
12
HTTP Request/Response Example…
Client Request
Server Response
The hello.html file was
The request was successful
requested from the server
test.com using HTTP version
1.1
the Web browser used was
Mozilla version 4.5
(status code 200) and returned
25 bytes of text
The server indicates the date
and time it thinks the resource
was requested and last
modified and the software it is
running (Apache version
2.0.52)
Web Application Resources
13
HTTP Request Methods
The HTTP command of the Web browser’s request
line
The Web server uses the request method to
determine what to do with the browser’s request
There are several methods defined by the HTTP 1.1
standard but only a few are widely supported by the
HTTP servers
The most widely used methods are:
GET – for retrieving information from a Web server
Can also be used to pass information to the Web server as part of a URL
HEAD – for verifying the existence of information on a Web server
POST – for sending (updating) information to a Web server
Web Application Resources
14
HTTP Request Methods…
Other http methods include:
PUT
DELETE
TRACE
TRACK
OPTIONS
CONNECT
Web Application Resources
15
HTTP Server Responses
Process client requests
The server generates an error if the resource requested cannot
be located
The response line of the server response has 3 parts:
Protocol version – should always be HTTP with
Status code – a three-digit indicator result code defined by the HTTP
specification
The first digit represents the category of the response
There are currently five categories:
Informational – the request was received and is being processed
Success – the client request was successful
Client error – the client’s request was incomplete or incorrect
Server error – the request was not fulfilled due to a server problem
Description phrase
Web Application Resources
16
Common Response Codes
Informational 1xx
100 Continue – the initial part of the request has been received and the
client should continue
200 OK – the client’s request was successful and the server’s response
contains the resource requested
204 No Content – The request was successful but the response is
empty
Redirection 3xx
301 Moved Permanently – the URL requested is no longer valid
302 Found (Moved Temporarily) – the URL requested currently resides
in a different location
304 Not Modified – the client performed a conditional GET and the
document has not been modified
Web Application Resources
17
Common Response Codes…
Client Error 4xx
400 Bad Request – the server could not understand the
request
403 Forbidden – the client requested data that it did not
have permission to access
404 Not Found – the resource requested was not found on
the server
Server Error 5xx
500 Internal Server Error – something unexpected
happened on the server side
Web Application Resources
18
HTTP Headers
Used to transfer Information between the client and
server
Has a name and value associated with it
There is one header per line
Web Application Resources
19
Common Request Headers
Accept – specifies the client’s preferred media type
Cookie – contains cookie information (name/value
pair) for the requested URL
If-Modified-Since – used for a conditional GET
request (when a document has been modified)
Referrer – allows the client to specify the URL of the
page from which the currently requested URL was
obtained
User-Agent – identifies the Web browser software
Web Application Resources
20
Common Response Headers
Server – identifies the server software
Set-Cookie – Allows the server to set a cookie on the
client browser (when permitted) for the given URL or
domain
Web Application Resources
21
Common Entity Headers
Content-Length – specifies the size (in bytes) of the data
transferred in the entity body
Content Type – specifies the MIME Type of the data
returned in the entity body
Expires – specifies the date/time after which the
response is considered outdated
Last-Modified – specifies the date/time the document
was last modified
Web Application Resources
22
Other Web-Related Servers
Some of the most common servers that run along HTTP
servers are:
Proxy servers
Streaming Audio/Video
File Transfer Protocol (FTP)
Databases
Secure Socket Layer (SSL)
Web Application Resources
23
Proxy Servers
An intermediary server between a client and destination
server
Allows extra processing of returned data
Have three main uses:
Security – act as a firewall by rejecting other protocols
Content filtering – restricts access to content based on file
type
Caching – stores frequently accessed pages
Web Application Resources
24
Streaming Audio and Video
Allows a media player (or plug-in) to start playing multimedia
content while data is still being received
Can broadcast live audio/video feeds or serve prerecorded
clips
Web browsers employ a plug-in to view any type of streaming
content
Unlike HTTP, many streaming media formats may use User
Data Protocol (UDP) instead of TCP/IP as a network protocol
UDP is good for transmitting very small pieces of data quickly
UDP will not retransmit data if there is an error
UDP is faster than TCP/IP although TCP/IP is more reliable
Web Application Resources
25
File Transfer Protocol (FTP)
Used to transfer files between computers on a
network
Relies on client and server software, unlike HTTP
FTP daemon (FTPD) runs on the server to allow
clients to connect
It provides a means of authentication for only authorized
users to transfer files
UNIX servers generally install an FTPD by default
Web Application Resources
26
Server-Side Programming
Server-side programs provide dynamic content and allows
interaction with users using:
Perl
Active Server Pages (ASP)
ASP.NET
Java Server Pages (JSP) and Java Servlets
PHP: Hypertext Preprocessor (PHP)
Coldfusion
Web Application Resources
27
Databases
Database – a collection of data and metadata about related
entities
A large corporate database should typically be installed on its own
dedicated server and not on a Web server machine
Metadata – data about other data
Database management system (DBMS) – software that is
used to manipulate a database
Structured Query Language (SQL) – language built in relational DBMSs to
create and manipulate databases
E.g. of relational DBMSs include Oracle, MySQL, Microsoft SQL Server,
Microsoft Access etc
Web Application Resources
28
Secure Socket Layer (SSL)
A protocol that allows secure, encrypted
communication over TCP/IP
Often used with HTTP to allow information exchange
between a Web browser and a Web server
Most commercial Web server software includes an
SSL server that can run alongside the HTTP daemon
(HTTPD)
An Internet socket is defined as a combination of an
IP address, a port, and a protocol
Web Application Resources
29