Adding a virtual host alias to an enterprise application targeted for a WAS
You can configure virtual host aliases in conjunction with ports for a WebSphere® Application Server. 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
To add a virtual host use the WAS Deployment editor by completing the following steps:
- Create an enterprise application and target the server to a WAS v6.0, or later.
- Switch to the Java™ EE perspective.
- The location of the WAS Deployment editor depends on the specification-level of your enterprise application project:
- If your enterprise application (EAR) project is at 1.2, 1.3 or 1.4 specification-level, complete the following steps:
- In the Enterprise Explorer view, expand your enterprise application project folder.
- Under the enterprise application project folder for which you want add or edit server configurations, double-click the
Deployment Descriptor to open the Application Deployment Descriptor editor.
- Select the
Deployment tab at the bottom of the editor.
Restriction: Before adding or removing J2EE modules, using the
Module page in the Application Deployment Descriptor editor, first click the
Deployment tab to activate the functions in the deployment page. Then add or remove your modules from the Module page. You need to complete this task for each Application Deployment Descriptor editor session that you want to add or remove modules from the Module page.
- If your enterprise application (EAR) project is at 5.0 specification-level, complete the following steps:
- In the Enterprise Explorer view, right-click your enterprise application project folder.
- Select
Java EE | Open WAS Deployment.
- 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 virtual host entries has been added to the deployment descriptor files.