18 chapters, hosting

Storage of content resources, coordination and management responsibility collectively known as Web hosting

Many Web hosting by some customers who share a computer to provide cheap Web hosting service, which is called shared hosting or virtual hosting

 

1, trying to get virtual hosting four ways to work properly:

Virtual hosting (understand) the URL path

  Add a special section in the URL path to the server to determine which site

For Hosting (understand) by port number

  A different port number assigned to each station, so that requests handled by a separate instance of the Web server

For Hosting (used) by the IP [Address

  A special IP address assigned to different virtual sites, these addresses are bound to a single machine. Such Web server can be identified by the IP address of the Web site name

Problems encountered:

  On the computer system to bind the virtual IP address is usually limited

  IP address scarce resources

  When the trustee to increase capacity by copying the server, IP address shortage problem is more serious.

Hosting, by Host header

  Browser and server implementors extended HTTP, the original host name to the server.

  The host name (and port number) on all transmission request Host header extension.

GET /index.html HTTP/1.1
User-agent :SuperBrowser  v1.3
Host : www.joes-hardware.com

 

2, HTTP / 1.1 Host header of

2.1, Host header is a header of HTTP / 1.1 Request defined in the RFC2068. The vast majority HTTP client (even if it is not to follow a client of HTTP / 1.1), have achieved Host header.

Host header describes the Internet host and port number of the requested resource is located , and original URL in the same

Host = "Host" ":"  host [ ":" port ]

 Note:

a), if the header does not comprise Host port, use the default port address scheme

b), if the URL contains an IP address, Host header should contain the same address;

c), if the URL contains the host name, Host header must contain the same name;

d), if the URL contains the host name, Host header should not be included in the URL host name corresponding to the IP address

  Because it would disrupt the work of virtual hosting servers, which are stacked a lot of virtual sites on the same IP address

e), if the URL contains the host name, Host header should not include this additional alias host name, as this will disrupt the work of virtual hosting server

f), if the client explicitly use a proxy server, the client must be the original server, rather than the proxy server name and port on the Host header.

g), Web client must contain all Host header in the request packet;

h), Web proxy must request before forwarding the message, add a header Host;

j), HTTP / 1.1 Web server must respond with a status code 400 for all Host header field is missing HTTP / 1.1 Request packet

  

2.2, missing Host header may default will direct users to a Web page may return an error page recommend that you upgrade your browser.

 

2.3、

Original master server (master origin server): original content comprising

Replication origin server (replica origin server): mirror server receiving content from the original master server

 

2.4, the client requests to a particular server

  HTTP redirection: the URL of the content will resolve to the IP address of the primary server, then it will send a redirect to the replication server

  DNS redirection: the URL of the requested content will be resolved to several IP addresses, DNS server IP address can choose to send to the client

 

2.5, content delivery networks

  CDN: specialized distribution network for specific content. The nodes in the network can be a Web server, reverse proxy or cache

  The difference between the mirror and the reverse proxy server that the reverse proxy is generally demand-driven. They do not save the original copy of the entire contents of the server, which saves only that part of the client request.

  Reverse proxy having "prefetch characteristic" ----- would be loaded from the server before the content requested by the user

 

2.6, make your site faster

  Caching proxy server or a distributed cluster and reverse proxy server dispersed network traffic congestion can be avoided, so as to distribute content closer to the end user, from the server to the client so that the transmission time is even shorter.

   Requests and responses through the Internet, the client and server-side resource access transmission mode is the most important factor affecting the speed.

 

Guess you like

Origin www.cnblogs.com/liuzhiyun/p/11519579.html