304 WebSphere Application Server V8.5 Administration and Configuration Guide for the Full Profile
application servers, and click the server name to open the configuration page. In the
Container settings section, expand Web Container Settings, and click Web container.
7.8 Creating and updating virtual hosts
By default, default_host is associated with all user application requests. The following
examples show cases in which multiple virtual hosts must be created:
Applications with conflicting URIs
Special support for extra ports
Providing independence of each virtual host for applications and servers
To create a new virtual host:
1. Click Environment Virtual hosts, and then click New.
2. Enter a name for the virtual host, and click Apply. Note that two links become active: Host
Aliases and MIME Types.
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
WebSphere Application Server servers. 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
sends the request to the application server 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, 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 sites:
– 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, it
passes the request to the web server. The web server looks in the
web_server_root/htdocs directory for the content. If it finds the content, it serves the page
to the client. If it does not find the content, an HTTP 404 response is returned to the client.
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.
6. Save your changes.
Host aliases can also be updated for virtual hosts through the administrative console. To
update, complete the following steps:
1. Click Environment Virtual hosts.
2. Click the virtual host name to open the configuration page.
3. Click Host Aliases in the Additional Properties pane.
Note: If the virtual host is used in a cluster environment, all host aliases used by
servers in the cluster must be registered in the virtual host.