Previous | Home | Next
Create 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:
- Click...
Environment | Virtual hosts | New
- Enter a name for the virtual host, and click Apply. Note that two links become active: Host Aliases and MIME Types.
Click...
Additional Properties | Host Aliases | New
- 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 WAS servers. They are the host names and port numbers 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.
Map 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 for content in....
web_server_root/htdocs
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.
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.
- Save your changes.
Host aliases can also be updated for virtual hosts through the dmgr console....
- Click...
Environment | Virtual hosts | virtual host name | Additional Properties | Host Aliases | New
- Enter values for the Host Name and Port fields and click OK.
If you create, delete, or update virtual hosts, you need to regenerate the web server plug-in.
One situation that requires creating a new virtual host is the need to secure communication between an unmanaged HTTP server and the application server.This communication can be secured so that it accessed only one specific application from all the applications hosted by that server...
- Add a new secure port to the HTTP server configuration (other than the default 443).
- Generate and configure new certificates for the secure port of the HTTP server.
- Add a new web container transport chain with a new secure port to the application server.
- Generate and configure new certificates for the secure port of the application server.
- Create a new virtual host.
- Add the new port of the application server and the new port of the HTTP server to the new virtual host.
- Restart the application server.
- Re-generate the plug-in for the application server.
- Manually update the plug-in and configuration of the HTTP server, and map the application on the new virtual host.
- Update the HTTP server plug-in key stores with the certificate for the new secure port of the application server.
- Restart the HTTP server.