Search This Blog

Wednesday, December 16, 2009

What is virtual Host and how to configure it in WebSphere?

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 host name 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. Use unique name as described in Warning: no string named [ccws_vhost_alias] found..
If more than one match is found and the matches are not for the same Application Server, an error is returned if the application is not on the Application Server with the first matching entry.
An Application Server provides a default virtual host with some common aliases, such as the machine 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 localhost:80 in the request http://localhost:80/myServlet.
A virtual host is not associated with a particular node (machine). It is a configuration, rather than a "live object," explaining why you can create it, but cannot start or stop it. For many users, creating virtual hosts is unnecessary because the default_host is provided.
Adding a local host to the virtual hosts adds the host name and IP address of the local host machine to the alias table. This allows a remote user to access the administrative console.
Configure it:
Create a virtual host using the Virtual Hosts page of the administrative console. Click Environment > Virtual Hosts from the navigation tree of the console, click New and, on the settings page for a virtual host that displays, specify an administrative name for the virtual host.
When you create a virtual host, a default set of 90 MIME entries is created for the virtual host.
Determine whether you need a virtual host alias for each HTTP transport port. There must be a virtual host alias corresponding to each port used by an HTTP transport. There is one HTTP transport in each Web container, with one Web container in each application server.
You must create a virtual host for each HTTP port in the following cases:
You are using the internal HTTP transport with a port other than the default of 9080, or for some reason the virtual host does not contain the usual entry for port 9080.
You have created multiple application servers (either stand-alone or in a cluster) that are using the same virtual host. Because each server must be listening on a different HTTP transport port, you need a virtual host alias for each one's transport port.
If you determine that you need one or more virtual host aliases, on the HTTP Transports page, note the Port values, such as 9080 or 9082.
If necessary, create a virtual host alias for each HTTP transport port.
From the Virtual Hosts page, click on your virtual host and, on the settings page for a virtual host, click Host Aliases. For each virtual host alias that you need, on the Host Aliases page, click New; then, on the settings page for a virtual host alias, specify a host name and port. Configure the virtual host to contain an alias for the port number. For example, specify an alias of *:9082 if 9082 is the port number in use by the transport.
When you enter the URL for the application into a Web browser, include the port number in the URL.
For example, if 9082 is the port number, specify a URL such as http://localhost:9082/wlm/SimpleServlet
If MIME entries are not specified at the Web module level, define MIME object types and their file name extensions. For each needed MIME entry, on the MIME Types page, click New; then, on the settings page for a MIME type, specify a MIME type and extension.
After you configure a virtual host alias or change a configuration, you must regenerate the Web server plug-in configuration and restart WebSphere Application Server.

No comments:

Post a Comment