Web Servers
Web Servers
Web Servers
Topics
Web Server Definition
Web Site versus Web Server
Steps in Handling a Client Request
Access Control
Dynamically Generated Responses
Passing Data to/from the Script
Creating and Using Cookies
Sharing Information Across Requests
Server Architecture
Server Hosting
Case Study of the Apache Web Server
2 Web Protocols and Practice
WEB SERVERS
Access Control
A Web server may limit which users can access
certain resources. Access control requires a
combination of authentication and
authorization.
Authentication identifies the user who originated
the request.
Authorization determines which users have
access to a particular resource.
AUTHENTICATION
Most client-server systems authenticate a user by asking for
a name and password.
Web server must perform authentication for every request
for a resource that has access restrictions.
The server returns an HTTP response that indicates that the
request requires authorization.
The response also identifies what kind of authentication is
required.
The response also identifies the realm
a string that associates a collection of resources at
the server
AUTHORIZATION
To control access to Web resources, the server must
employ an authorization policy.
A policy typically expressed in terms of an access control
list that enumerates the users who are granted or denied
access to the resources.
In addition to checking the user name, the server may
allow or deny access to the resource based on other
information associated with the HTTP request, such as
the host name or IP address of the requesting client.
Authenticating HTTP requests can impose a heavy load
on the Web server.
Server-Side Include
A server-side include instructs the Web server
to customize a static resource based on
directives in an HTML-like file.
Server Script
A server script is a separate program that generates
the request resource.
The program may run as
Part of the server
A separate process
The main role of the Web server is
To associate the requested URL with the appropriate script
To pass data to/from the script
The main role of the script is
To process the input from the server
To generate the content to the client
Server Script
The server can interact with the script in
several different ways:
Separate process invoked by the server
Software module in the same process
Persistent process contacted by the server
Server Architecture
Some techniques for allocating system
resources among competing client
requests are :
Event-driven server architecture
Process-driven server architecture
Hybrid server architecture
Server Hosting
Multiple Web sites on a single machine
Multiple machine for a single Web site
o Figure 4.1.
1
www.foo.com
www.bar.com
2
www.big.com
Surrogate
To/From Internet 3
www.big.com
4
www.mid.com
Figure 4.1. Hosting complex with surrogate in front of four server machines
Table 4.2 Key configuration directives for child processes and network
connection
Table 4.3 Built-in handlers in Apache server and default file extension