Ive always wonder how its possible to host many websites on one server.
For example dreamhost can have 100+ pages hosted on one server,
how is this abstracted?
Does it have 1 ip for every webpage hosted?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityIve always wonder how its possible to host many websites on one server.
For example dreamhost can have 100+ pages hosted on one server,
how is this abstracted?
Does it have 1 ip for every webpage hosted?
From the Wikipedia article on Shared Web Hosting:
Name-based
In name-based virtual hosting, also called shared IP hosting, the virtual hosts serve multiple hostnames on a single machine with a single IP address. When a web browser requests a resource from a web server using HTTP/1.1 it includes the requested hostname as part of the request. The server uses this information to determine which web site to show the user.
IP-based
In IP-based virtual hosting, also called dedicated IP hosting, each virtual host has a different IP address. The web server is configured with multiple physical network interfaces, or virtual network interfaces on the same physical interface. The web server software uses the IP address the client connects to in order to determine which web site to show the user. The primary reason for a site to use a dedicated IP is to be able to use its own SSL certificate rather than a shared certificate.
From the article on Server Name Indication (SNI):
Server Name Indication (SNI) is an extension to the Transport Layer Security (TLS) computer networking protocol by which a client indicates which hostname it is attempting to connect to at the start of the handshaking process.1 This allows a server to present one of multiple possible certificates on the same IP address and TCP port number and hence allows multiple secure (HTTPS) websites (or any other service over TLS) to be served by the same IP address without requiring all those sites to use the same certificate.