IBM


4.7.1 Creating a virtual host

By default, default_host is associated with all user application requests. There are some cases in which multiple virtual hosts should be created, for example:

Applications having conflicting URIs

Support for extra ports, such as port 443 for SSL

Keep clear independence of each virtual host for applications and servers

The configuration of a virtual host is applied to an entire cell. To create a new virtual host...

1. Select Environment   | Virtual Hosts and then click New.

2. Enter a name for the virtual host and click Apply.

3. Click Host Aliases in the Additional Properties pane.

4. Click New.

5. Enter values for the Host Name and Port fields and click OK.

The host aliases are not necessarily the same as the host name and port number of the WASs. They are the host names and port numbers that the Web server plug-in is expecting to receive from the browser. The Web server plug-in will send the request to the appserver using the host name and port number in the transport setting for that server. If the Web server is running on a separate machine from WebSphere, then the host aliases are for Web server machines.

Mapping HTTP requests to host aliases is case sensitive and the match must be alphabetically exact. Also, different port numbers are treated as different aliases.

For example, the request http://www.myhost.com/myservlet does not map to any of the following:

http://myhost/myservlet

http://www.myhost.com/MyServlet

http://www.myhost.com:9876/myservlet


If the Web server plug-in receives a request that does not match one of the virtual hosts, then an HTTP error will be returned to the user.

Simple wild cards can be used on the host aliases. A * can be used for the host name, the port or both. It means that any request will match this rule.

If the virtual host is used in a cluster environment, all host aliases used by servers in the cluster should be registered in the virtual host. For information about how to do this, see 7.3.1, Regenerating the plug-in configuration file.

6. Multi-Purpose Internet Mail Extensions (MIME) mappings associate a file name extension with a type of data file, such as text, audio, or image. A set of MIME types is automatically defined for you when you create a virtual host. To see or alter the MIME types associated with this new virtual host, click MIME Types in the Additional Properties section of the virtual host.

7. Click New to add a MIME type.

8. Enter the MIME type and extension. Click Apply to continue adding new types or click OK if you are finished.

9. Click Save on the taskbar and save your changes.

Important: If you create, delete, or update virtual hosts, regenerate the Web server plug-in.


Redbooks ibm.com/redbooks

Next