Configure virtual hosts

 


Overview

Virtual hosts enable you to isolate, and independently manage, multiple sets of resources on the same physical machine.

 

  1. Create a virtual host using the Virtual Hosts page of the administrative console...

    Environment | Virtual Hosts | New | settings page for a virtual host

  2. 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.

  3. 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 appserver.

    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 appservers (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.

  4. 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.

  5. 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

  6. 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.

  7. After you configure a virtual host alias or change a configuration, regenerate the Web server plug-in configuration and restart WebSphere Application Server.

  8. If after restarting your server, the virtual host is still not recognized, edit...

    /opt/WebSphere/DeploymentManager/config/cells/twainNetwork/virtualhosts.xml

    ...and add the appropriate alias lines. For example...

        <aliases xmi:id="HostAlias_1" hostname="*" port="9080"/>
        <aliases xmi:id="HostAlias_2" hostname="*"/>
        <aliases xmi:id="HostAlias_3" hostname="*" port="9443"/>
        <aliases xmi:id="HostAlias_4" hostname="*" port="9081"/>
    
    
    ...and then restart the deployment manager.

    stopManager.sh -usernmae user -password password
    startManager.sh


Virtual hosts
Transports
Exporting applications
Virtual host collection

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.