2. WEB SITE & WEB SERVER
• Web site : consist of a collection of web pages associated with a particular
hostname
• Web server : is a program to satisfy client request for web resources
• It used to host web pages but there exist different web servers for gaming, storage etc.
3. HOW IT HANDLES A CLIENT REQUEST ?
• Parsing the request message
• Checking that the URL is authorized
• Associating the URL in the request with a file
name
• Constructing the response message
• Transmitting the response message to the
requesting client
4. Common Gateway Interface offers a standard protocol for web servers to execute programs that execute
like console applications running on a server that generates web pages dynamically
5. ACCESS CONTROL
• Authentication
• Identifies the user who originated the request
• Name and password
• Authorization
• Determines which users have access to a particular resource
• Based on the information associated with the HTTP request(host name or ip address)
6. DYNAMICALLY GENERATED RESPONSES
• Server side include
• Instruct the web server to customize a static resources based on directives in an HTML-like file
• Server script
• Separate program that generates the request resource
• Program run as :
• Part of the server
• A separate process
• Role of web server:
• Associated with the URL with the appropriated script
• To pass the data to and from the script
• Role of script is
• Process the input from the server
• Generate the content to the client
7. CREATING AND USING COOKIES
• To generate dynamic responses cookies are used
• Browser asked to include a unique cookie in each HTTP request
• If the request doesn't include cookie, the script create a new cookie in the header
of the response message
• Set-cookie: customer:”user30”;version=“1”;path=“/book”
• Subsequent requests from the user would include the cookie
• Cookie: Customer=“user30”;version=“1”;path=“/book”
• Script can use COOKIE as user identifier in the interaction process
8. SHARING INFORMATION ACROSS REQUEST
• Server retain some information to reduce the overhead of handling future
request:
• Sharing HTTP responses across request
• Cache result is consistent with the primary copy of the information
• Sharing metadata across request
• Translation of url file
• Control information
• http response headers
• Server could also cache
• Current name
• Current date and time
9. SERVER ARCHITECTURE
• Event driven server architecture
• Process driven server architecture
• Hybrid server architecture
10. EVENT DRIVEN SERVER ARCHITECTURE
• Has a single process that alternates between servicing
different request
• Allows the server to serialize operation that modify the
same data
• Performs nonblocking systems calls
• Not used in most high end web servers
11.
12. PROCESS DRIVEN SERVER ARCHITECTURE
• Allocates each request to a separate process
• One master process listens for new connection
• The master process creates or forks a separate process for new
connection.
• Terminate the process after parsing the client request and
transmitting the responses
• To prevent memory leak
• Introduces overhead for switching from one process to another
13. HYBRID SERVER ARCHITECTURE
• Strengths of the event driven and process driven models
are combined
• Each process would become an event driven server that
alternates between a small collection of request
• A single process has multiple independent threads.
• Main process instructs a separate helper process to
perform time consuming operations