Virtual hosting: Difference between revisions
Removed advertisement |
|||
Line 24: | Line 24: | ||
Another issue with virtual hosting is the inability to host multiple secure websites running [[Secure Sockets Layer]] or SSL. Because the SSL [[handshaking|handshake]] takes place before the expected hostname is sent to the server, the server doesn't know which certificate to present when the connection is made. One workaround is to run multiple web server programs, each listening to a different incoming [[TCP and UDP port|port]], which still allows the system to just use a single IP address. If running multiple web server programs is considered clumsy, a more efficient solution is to select [[Transport Layer Security|TLS]] (TLS 1.1 or later, which enables name-based virtual hosting as of June 2003, documented in [http://www.ietf.org/rfc/rfc3546.txt RFC3546], and updated in [http://www.ietf.org/rfc/rfc4366.txt RFC4366]). Another option is to do [[IP alias]]ing, where a single computer listens on more than one IP address. |
Another issue with virtual hosting is the inability to host multiple secure websites running [[Secure Sockets Layer]] or SSL. Because the SSL [[handshaking|handshake]] takes place before the expected hostname is sent to the server, the server doesn't know which certificate to present when the connection is made. One workaround is to run multiple web server programs, each listening to a different incoming [[TCP and UDP port|port]], which still allows the system to just use a single IP address. If running multiple web server programs is considered clumsy, a more efficient solution is to select [[Transport Layer Security|TLS]] (TLS 1.1 or later, which enables name-based virtual hosting as of June 2003, documented in [http://www.ietf.org/rfc/rfc3546.txt RFC3546], and updated in [http://www.ietf.org/rfc/rfc4366.txt RFC4366]). Another option is to do [[IP alias]]ing, where a single computer listens on more than one IP address. |
||
==IP-based== |
''''''==IP-based== |
||
In IP-based virtual hosting each site (either a DNS hostname or a group of DNS hostnames that act the same) points to a unique IP address. The web server is configured with multiple physical network interfaces, virtual network interfaces on the same physical interface or multiple IP addresses on one interface<!--yes there is a distinction at least on linux-->. |
In IP-based virtual hosting each site (either a DNS hostname or a group of DNS hostnames that act the same) points to a unique IP address. The web server is configured with multiple physical network interfaces, virtual network interfaces on the same physical interface or multiple IP addresses on one interface<!--yes there is a distinction at least on linux-->. |
||
Line 30: | Line 30: | ||
===Cons=== |
===Cons=== |
||
The server needs a different IP address for every web site which means higher costs of web site hosting and leads to [[IP address exhaustion]]. |
The server needs a different IP address for every web site which means higher costs of web site hosting and leads to [[IP address exhaustion]].'''''''''Bold text''''''''' |
||
== Headline text == |
|||
==Uses== |
==Uses== |
Revision as of 08:31, 16 February 2009
This article needs attention from an expert in Computer networking. Please add a reason or a talk parameter to this template to explain the issue with the article.(November 2008) |
- "vhost" redirects here, for vhosts in relation to Internet Relay Chat see Vhost (IRC)
Virtual hosting is a method that servers such as web servers use to host more than one domain name on the same computer, sometimes on the same IP address.
Virtual web hosting is one of the most popular hosting options available at the moment—probably because it is one of the most cost effective options on the market. Also known as shared web hosting, virtual hosting allows a website owner to have a site hosted on a web server that is shared with other websites. In simple terms, the virtual hosting company's server will allocate out hosting services and bandwidth to more than one website. Virtual web hosting is a cheaper hosting option because you won't have to pay for a dedicated server to host just your website.
Virtual web hosting is a good solution for small- to medium-sized (and even some larger) websites that aren't constantly being visited or that have reasonable bandwidth needs.
There are two basic methods of accomplishing virtual hosting: name-based, and IP address or ip-based.
Name-based
Name-based virtual hosts use multiple host names for the same webserver IP address.
With web browsers that support HTTP/1.1 (as nearly all now do), upon connecting to a webserver, the browsers send the address that the user typed into their browser's address bar (the URL). The server can use this information to determine which web site, as well as page, to show the user. The browser specifies the address by setting the Host HTTP header with the host specified by the user. The Host header is required in all HTTP/1.1 requests.
For instance, a server could be receiving requests for two domains, www.site1.com and www.site2.com, both of which resolve to the same IP address. For www.site1.com, the server would send the HTML file from the directory /var/www/user/Joe/site/, while requests for www.site2.com would make the server serve pages from /var/www/user/Mary/site/.
Cons
If the Domain Name System (DNS) is not properly functioning, it becomes much harder to access a virtually-hosted website. The user could try to fall back to using the IP address to contact the system, as in http://10.23.45.67/. The web browser doesn't know which hostname to use when this happens; moreover, since the web server relies on the web browser client telling it what server name (vhost) to use, the server will respond with a default website—often not the site the user expects.
A workaround in this case is to add the IP address and hostname to the client system's hosts file. Accessing the server with the domain name should work again. Users should be careful when doing this, however, as any changes to the true mapping between hostname and IP address will be overridden by the local setting. This workaround is not really useful for an average web user, but may be of some use to a site administrator while fixing DNS records.
Another issue with virtual hosting is the inability to host multiple secure websites running Secure Sockets Layer or SSL. Because the SSL handshake takes place before the expected hostname is sent to the server, the server doesn't know which certificate to present when the connection is made. One workaround is to run multiple web server programs, each listening to a different incoming port, which still allows the system to just use a single IP address. If running multiple web server programs is considered clumsy, a more efficient solution is to select TLS (TLS 1.1 or later, which enables name-based virtual hosting as of June 2003, documented in RFC3546, and updated in RFC4366). Another option is to do IP aliasing, where a single computer listens on more than one IP address.
'==IP-based== In IP-based virtual hosting each site (either a DNS hostname or a group of DNS hostnames that act the same) points to a unique IP address. The web server is configured with multiple physical network interfaces, virtual network interfaces on the same physical interface or multiple IP addresses on one interface.
The web server can obtain the address the TCP connection was intended for using a standard API and use this to determine which website to serve. The client is not involved in this process and therefore (unlike with name based virtual hosting) there are no compatibility issues.
Cons
The server needs a different IP address for every web site which means higher costs of web site hosting and leads to IP address exhaustion.''''Bold text''''
Headline text
Uses
Virtual web hosting is often used on large scale in companies whose business model is to provide low cost website hosting for customers. The vast majority of such web hosting service customer websites worldwide are hosted on shared servers, using virtual hosting technology.
Many businesses utilize virtual servers for internal purposes, where there is a technology or administrative reason to keep several separate websites such as customer extranet website, employee extranet, internal intranet, intranets for different departments. If there are not security concerns in the website architectures, they can be merged into a single server using virtual hosting technology, which reduces management and administrative overhead and the number of separate servers required to support the business.