web hosting herng-yow chen. outline how different web site can be “ virtually hosted ” on the...

24
Web Hosting Herng-Yow Chen

Upload: delilah-harrington

Post on 03-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

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

client

Internet

Irene’s ISP

www.joes-hardware.com

www.cajun-gifts.com

www.marys-antiques.com

www.irenes-isp.com

Content

Content

Mary

Joe

Virtual Hosting

Virtual Hosting

client

client

Internet

Irene’s ISP

www.joes-hardware.com

www.cajun-gifts.com

www.marys-antiques.com

www.irenes-isp.com

Content

Content

Mary

Joe

Virtual server request lacks Host information

Virtual Server Request Lacks Host Information

Client A

Client B

Internet

(A getting http://www.joes-hardware.com/index.html)

GET /index.html HTTP/1.0User-agent: SuperBrowser v1.3

www.voting-info.govwww.joes-hardware.comwww.marys-antiques.com

GET /index.html HTTP/1.0User-agent: WebSurfer 2000

(B getting http://www.marys-antiques.com/index.html)

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

http://www.joes-hardware.com/joe/index.html

http://www.marys-antiques.com/mary/index.html

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

www.voting-info.gov=209.172.34.2www.joes-hardware.com=209.172.34.3www.marys-antiques.com=209.172.34.4

209.172.34.3

209.172.34.4

Dest IP address Directory209.172.34.2 /voting209.172.34.3 /joe209.172.34.4 /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 http://www.joes-hardware.com/index.html) GET /index.html HTTP/1.1

User-agent: SuperBrowser v1.3Host: www.joes-hardware.com

www.voting-info.govwww.joes-hardware.comwww.marys-antiques.com

GET /index.html HTTP/1.1User-agent: WebSurfer 2000Host: marys-antiques.com

(B getting http://www.marys-antiques.com/index.html)

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 Client

Client

Client

Client

Internet

Replica origin server

Master origin server

Replica origin servers

Switch

Mirrored Server Farms (cont.)

New YorkReplica origin server

Chicago (HQ)Master origin server

MiamiReplica origin server

Little RockReplica origin server

Internet

Content distribution networks

Surrogate caches in CDNs Proxy caches in CDNs

Proxy Caches in CDNs

Client

Client

Client

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

http://www.ietf.org/rfc/rfc3040.txt RFC 3040, “Internet Web Replication and Caching Taxonomy,” i

s a reference for the vocabulary of web replication and caching applications.

http://search.ietf.org/internet-drafts/draft-ietf-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 serv

er.