Hostname aliases

There is one more important feature that comes with Tomcat 7 called Host name aliases. It's a very good feature that gives freedom to the administrator for multiple sites on the same network

For example, if you have a website which needs to be accessed through a subdomain by different users, then host aliases are created. It's also called Sub domain aliases for the main domain. It is not possible to implement aliases in the previous versions of Tomcat. In case we want to implement aliases for any website, we have to use Apache, IIS, or a separate web server before Tomcat as a front-end server.

The following mentioned code describes how to set the alias for a particular site:

<Host name="www.xyz.com" appBase="../Webapps"> <Context ...

Get Apache Tomcat 7 Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.