IBM


14.1.4 Defining the Plants by WebSphere virtual host

Enhanced EAR file users: If you are using an Enhanced EAR file, the virtual host can be defined at packaging time. See Adding a virtual host.

Web modules need to be bound to a specific virtual host. For our sample, we chose to bind the PlantsByWebSphereWeb module to a specific virtual host called plantsbywebsphere_host. This virtual host has the following host aliases:

www.plantsbywebsphere.com:80

www.plantsbywebsphere.com:9081

Any request starting with <plantsbywebsphere_host_alias>/PlantsByWebSphere, such as http://www.plantsbywebsphere.com:9081/PlantsByWebSphere, is served by the Plants by WebSphere application.

Tip: You can restrict the list of hosts used to access the Web application by removing hosts from the virtual host definition.

Imagine you want to prevent users from directly accessing the Plants by WebSphere application from the WebSphere internal HTTP server when they invoke http://www.plantsbywebsphere.com:9081/PlantsByWebSphere. In other words, you want to force all requests to go through the Web server plug-in. You can achieve this by removing www.plantsbywebsphere.com:9081 from the virtual host aliases list.

To create the plantsbywebsphere_host virtual host...

1. Select the Environment  | Virtual Hosts entry in the navigation pane.

2. Click New.

3. Enter the virtual host name, plantsbywebsphere_host.

4. Click Apply.

5. Select Host Aliases in the Additional Properties section.

6. Add the two aliases shown in Figure 14-3 by clicking New, entering the values, and clicking OK.

Figure 14-3 WebSphere Bank virtual host aliases

7. Click OK.

8. Save the configuration.


Redbooks ibm.com/redbooks

Next