Web Hosting Herng-Yow Chen
Outline How different web site can be “ virtually hosted ” on the same server, and how this affects HTTP How to make web sites more reliable under heavy traffic How to make web site load faster
Hosting services
A Simple Example : Dedicated Hosting client Internet Irene ’ s ISP Content Mary Joe
Virtual Hosting
client Internet Irene ’ s ISP Content Mary Joe
Virtual server request lacks Host information
Virtual Server Request Lacks Host Information Client A Client B Internet (A getting GET /index.html HTTP/1.0 User-agent: SuperBrowser v GET /index.html HTTP/1.0 User-agent: WebSurfer 2000 (B getting HTTP/1.0 requests do not contain hostname information, so they do not support web servers that host multiple web sites. (HTTP/1.1 supports a Host header to fix this problem) /voting /mary /joe
Making virtual hosting work Virtual hosting by URL path Virtual hosting by port number Virtual hosting by IP address Virtual hosting by Host header
Virtual hosting by URL path The problem?
Virtual hosting by port number Install multiple HTTP servers one listens 80 one listens 81, and so on. The problem?
Virtual hosting by IP address Multiple IPs are assigned to single computer. Different IP corresponds to different host. The problem?
Virtual hosting by IP address Client A Client B Internet /voting /mary /joe Dest IP address Directory /voting /joe /mary
Virtual hosting by Host header HTTP/1.1 solution Use single IP, single port to serve incoming HTTP requests to different hosts.
Virtual hosting by Host header Client A Client B Internet (A getting GET /index.html HTTP/1.1 User-agent: SuperBrowser v1.3 Host: GET /index.html HTTP/1.1 User-agent: WebSurfer 2000 Host: marys-antiques.com (B getting The HTTP Host header carries the hostname information that would otherwise be lost in normal server requests,allowing name-based virtual hosting /voting /mary /joe
HTTP/1.1 Host Headers Syntax and usage Missing Host headers Interpreting Host headers Host headers and proxies
Making web sites reliable There are several times during which web sites commonly break: Server downtime Traffic spikes Network outages or losses Some ways of anticipating and dealing with the problems Mirrored server farms Content distribution networks
Mirrored server farms HTTP redirection DNS redirection Discussed in Chapter 20.
Mirrored Server Farms Client Internet Replica origin server Master origin server Replica origin servers Switch
Mirrored Server Farms (cont.) New York Replica origin server Chicago (HQ) Master origin server Miami Replica origin server Little Rock Replica origin server Internet
Content distribution networks Surrogate caches in CDNs Proxy caches in CDNs
Proxy Caches in CDNs Client Internet and lots of origin servers Caching Proxy Switch
Making web sites faster Many of the technologies mentioned in the previous slides also help web site load faster. Server farms and distributed proxy caches or surrogate servers distribute network traffic, avoiding congestion. Distributing the content brings it closer to end users, so that the travel time from server to client is lower. The key to speed of resource access is how requests and responses are directed from client to server and back across the Internet. (see more details in next lectures, redirection methods.) Another approach to speeding up web sites is encoding the content for fast transporting. Namely, compressing the content. (see Transfer Encoding and Chunked Encoding for details.)
Reference RFC 3040, “ Internet Web Replication and Caching Taxonomy, ” is a reference for the vocabulary of web replication and caching applications. cdi-request-routing-reqs-00.txt cdi-request-routing-reqs-00.txt “ Request-Routing Requirements for Content Internetworking. ” Apache: The Definitive Guide Ben Laurie and Peter Lauire, O ’ Reilly & Associates, Inc. This book describes how to run the open source Apache web server.