Class Two & Three
Class Two & Three
Class Two & Three
Note: needs to be upgraded from time to time to check latest potential security
problems.
Applications of Intranet
Management Problems
A company may not have person to update their Intranet on a routine basis
Fear of sharing information and the loss of control
Security Problems
Unauthorized access
Denial of service
Extranet
Improved quality.
Lower travel costs.
Lower administrative & other overhead costs.
Reduction in paper work.
Delivery of accurate information on time.
Improved customer service.
Better communication.
Overall improvement in business effectiveness.
Disadvantages of Extranet
• Public
• Private
• Restricted
World Wide
Web
Web Server
Data Tier
RDBMS
What is a server?
A server is a computer program or a device that
provides functionality for other programs or
devices, called "clients". This architecture is called
the client–server model.
In the client/server programming model, a server
program awaits and fulfills requests from client
programs, which may be running in the same or
other computers.
A given application in a computer may function as
a client with requests for services from other
programs and also as a server of requests from
other programs.
Types of servers:-web server, application server,
proxy server, mail server, file server
Web Browser
The combination of the four IP address parts provides 4.2 billion possible
addresses (256 x 256 x 256 x 256).
This number seemed adequate until 1998.
Members of various Internet task forces are working to develop an
alternate addressing system that will accommodate the projected
growth.
However, all of their working solutions require extensive hardware and
software changes throughout the Internet.
TCP/IP Port number
protocol pathname
http://www.HiLCoE.net/webdevanddesign/index.htm
URL cannot contain special characters, such as blank or '~'. Special characters
are encoded, in the form of %xx, where xx is the ASCII hex code.
For example:-, '~' is encoded as %7e; '+' is encoded as %2b. A blank can be
encoded as %20 or '+'.
Read More:-https://en.wikipedia.org/wiki/Uniform_Resource_Name
URI,URL and URN
Domain Name Addressing
Most web browsers do not use the IP address to locate Web sites and
individual pages.
They use domain name addressing.
A domain name is a unique name associated with a specific IP address
by a program that runs on an Internet host computer.
This program, which coordinates the IP addresses and domain names for
all computers attached to it, is called DNS (Domain Name System )
software.
The host computer that runs this software is called a domain name
server.
Domain Name Addressing
You can navigate by entering a keyword or phase into a search text box.
Wake Up Quiz
1. Does the term internet and web the same thing? why?
2. What are servers? Example?
2.What is DNS?
3.What is are the four parts of the url?
Group Reading Assignment
Form a group and submit a paper with a maximum of 5 pages using the ff
details ,I would consider the group your forming to do this assignment the same as the one
you use in the final project.
Http is the set of rules for transferring files(text, graphics,….)on the WWW.
The rules governing the conversation between a Web client and a Web
server
What is a protocol?
In diplomatic circles, a protocol is the set of rules governing a
conversation between people
Read More:-https://technet.microsoft.com/en-
us/library/cc958821.aspx
http://www.omnisecu.com/tcpip/tcpip-model.php
The TCP/IP protocol layers
The application program is king – it gets work done using
the lower level layers for communication between the client
and server.
Get useful work done – retrieve Web pages,
Application copy files, send and receive email, etc.
Client Server
I would like to open
a connection OK
Display response
Close connection
OK
HTTP Request and Response Messages
Request Line
The first line of the header is called the request line, followed by
optional request headers.
The request line has the following syntax:
Request-method-name request-URI HTTP-version
request-method-name: HTTP protocol defines a set of request
methods, e.g., GET, POST, HEAD and OPTIONS. The client can use
one of these methods to send a request to the server. GET is the
most common HTTP method.
request-URI: specifies the resource requested. (local path of
requested resource)
The path is the part of the URL after the host name. This path is
also called the request Uniform Resource Identified (URI). A
URI is like a URL, but more general.
HTTP-Version: Three versions are currently in use: HTTP/1.0,
HTTP/1.1 and HTTP/2.0 (“HTTP/x.x” Uppercase)
HTTP Request Message…
GET / HTTP/1.1
Host: www.acme.com
HTTP/1.1 200 OK
Content-Type: text/html
<html>
<head><title>Acme, Inc Homepage</title></head>
<body><h1>Welcome to Acme!</h1> … </body>
</html>
66
HTTP Request Methods
HTTP protocol defines a set of request methods (also called
Verbs). A client can use on of these request methods to send
request message to an HTTP server. The methods are:
GET
HEAD
POST
PUT
DELETE
OPTIONS
TRACE
CONNECT
PATCH
HTTP Request Methods…
HEAD: Asks for the response identical to the one that would correspond
to a GET request, but without the response body. This is useful for
retrieving meta-information written in response headers, without having to
transport the entire content.
A client can use the HEAD request to get the header that a GET
request would have obtained. Since the header contains the last-
modified date of the data, this can be used to check against the
local cache copy.
POST: Requests that the server accept the entity enclosed in the request
as a new subordinate of the web resource identified by the URI. The data
posted might be, as examples, an annotation for existing resources; a
message for a bulletin board, newsgroup, mailing list, or comment thread;
a block of data that is the result of submitting a web form to a data-
handling process; or an item to add to a database.
HTTP Request Methods…
PUT: Requests that the enclosed entity be stored under the supplied URI.
If the URI refers to an already existing resource, it is modified; if the URI
does not point to an existing resource, then the server can create the
resource with that URI.
Ask the server to store the data.
TRACE: Echoes back the received request so that a client can see what (if
any) changes or additions have been made by intermediate servers.
Ask the server to return a diagnostic trace of the actions it takes.
HTTP Request Methods…
OPTIONS: Returns the HTTP methods that the server supports for the
specified URL. This can be used to check the functionality of a web server
by requesting ‘*’ instead of a specific resource.
Ask the server to return the list of request methods it supports.
CONNECT: Converts the request connection to a transparent TCP/IP
tunnel, usually to facilitate SSL-encrypted communication (HTTPS)
through an unencrypted HTTP proxy.
Used to tell a proxy to make a connection to another host and simply
reply the content, without attempting to parse or cache it. This is often
used to make SSL connection through the proxy.
PATCH: Is used to apply partial modifications to a resource.
HTTP severs are required to implement at least the GET and HEAD
methods and, whenever possible, also the OPTIONS method.
HTTP Request Methods…
Db.php
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: PUT, GET, POST,DELETE");
header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type,
Accept");
Index.php
fetch({
method:'get',
url:'http://localhost/db.php',
})
5.4.2 HTTP
RESPONSE MESSAGES
HTTP Response Message
Status Line
The first line is called the status line, followed by optional response
header(s).
The Status line has the following syntax:
HTTP-version status-code reason-phrase
Message Description
100 Continue Only a part of the request has
been received by the server, but
as long as it has not been
rejected, the client should
continue with the request
101 Switching Protocols The server switches protocol
HTTP Status Messages… (2xx: Successful)
Message Description
200 OK The request is OK
201 Created The request is complete, and a
new resource is created
202 Accepted The request is accepted for
processing, but the processing is
not complete
203 Non-authoritative
Information
204 No Content
205 Reset Content
206 Partial Content
HTTP Status Messages… (3xx: Redirection)
Message Description
301 Permanent A page has permanently move to
a new location.
302 Temporary Temporary redirection to a
resource.
HTTP Status Messages… (4xx: Client Error)
Message Description
400 Bad Request Incorrect or corrupted request,
that the server couldn’t
understand it
403 Forbidden Accessing the page or resource
you were trying to reach is
absolutely forbidden for some
reason.
404 Not Found The resource couldn’t not be
found on the server
HTTP Status Messages… (5xx: Server Error)
Message Description
500 Internal Server Error The request was not completed. The
server met an unexpected condition
501 Not Implemented The request was not completed. The
server did not support the
functionality required
502 Bad Gateway The request was not completed. The
server received an invalid response
from the upstream server
503 Service Unavailable The request was not completed. The
server is temporarily overloading or
down
504 Gateway Timeout The gateway has timed out
505 HTTP Version Not Supported The server does not support the “http
protocol” version
206 Partial Content
5.5 BEYOND HTTP
HTTP Limitations
200 OK
TCP close
GET
TCP open
200 OK
TCP close
86
HTTP Keep-Alive
200 OK
GET
200 OK
GET
87
HTTP Pipelining
88
5.6 STORAGE
Cookies
Client Server
Read about HTTP/1.0, HTTP/1.1 and HTTP/2 and compare the different
versions including what's new in HTTP/2.