Virtual hosts

A virtual host is a configuration enabling a single host machine to resemble multiple host machines. Resources associated with one virtual host cannot share data with resources associated with another virtual host, even if the virtual hosts share the same physical machine.

Each virtual host has a logical name and a list of one or more DNS aliases by which it is known. A DNS alias is the TCP/IP hostname and port number used to request the servlet, for example yourHostName:80. When no port number is specified, 80 is assumed.

When a servlet request is made, the server name and port number entered into the browser are compared to a list of all known aliases in an effort to locate the correct virtual host and serve the servlet. If no match is found, an error is returned to the browser.

An appserver provides a default virtual host with some common aliases, such as the machine's IP address, short host name, and fully qualified host name. The alias comprises the first part of the path for accessing a resource such as a servlet. For example, it is www.setgetweb.com:80 in the request:

http://www.setgetweb.com:80/HelloServlet

A virtual host is not associated with a particular node (machine). It is a configuration, rather than a "live object," explaining why it can be created, but not started or stopped. For many users, virtual host creation is unnecessary because the default_host is provided.

 

Two clusters in one instance

If you are going to run two more clusters in one instance of WASS you need to modify the virtualhosts.xml file to add the appropriate HTTP transport port numbers.

After creating your second cluster, and setting the unique transport ports within the server web containers, edit virtualhosts.xml, look for port "9080", copy the line, and in the new line add your new port and a new virtualhost id.

 

IP Aliasing

On an operating system level, you can assign multiple IP addresses to a single box by using IP Aliasing (known as multihoming in the Sun Solaris world).

 

See Also:

Why and when to use virtual hosting
The default virtual host (default_host)
How requests map to virtual host aliases
Configure virtual hosts