You can configure virtual host aliases in conjunction with ports
for a WebSphere® Application
Server v6.0. A virtual host is a single host machine to resemble multiple
host machines. An alias is the domain name system (DNS) host name and
port number used by a client to form the URL request for a Web application
resource (such as a servlet, JSP or HTML page). For example, an alias is the
"myhost:8080" portion of the URL http://myhost:8080/servlet/snoop.
Prerequisite
- Create an enterprise application and target the server to WebSphere Application
Server v6.0.
To add a virtual host, follow these steps:
- Switch to the J2EE perspective.
- In the Project Explorer view, expand the Enterprise
Applications folder.
- Under the enterprise application project folder for which you add
the virtual host, double-click the Deployment Descriptor to
open the Application Deployment Descriptor editor.
- Select the Deployment tab at the bottom
of the editor.
- Expand the Virtual Hosts section.
- A virtual host name for admin_host and default_host will already
be created for you. These are default entries, do not attempt to
remove or modify these configurations. In that case, you may skip the below
step if the predefined virtual host name satisfies your requirements.
- Create a virtual host name.
- Click the Add button beside the virtual
host name list table. The Add a Host Name Entry dialog box opens.
Restriction: You cannot add the default host names admin_host or default_host,
since these are reserved names by the server.
- In the host name field, specify the host
name of a single host machine to resemble multiple host machines.
- Create a host alias. The host alias list specifies a
list of available host names and their respective port numbers that were selected
from the virtual host name list.
- Beside the Host alias list box, click
the Add or Edit button. The Add Host Alias Entry dialog box opens.
- In the Host name field, type the IP address
or the DNS host name used by a client to request a Web application resource
(such as a servlet, JSP file, or HTML page). For example, the host alias name
might be myhost.
- In the Port field, type the port for
which the Web server has been configured to accept client requests. For example,
a port might be 8080 in a DNS name of myhost:8080.
- Save your changes and close the editor. The substitution
variables entries has been added to the deployment descriptor files.