O'Reilly logo

Apache Tomcat 7 Essentials by Tanuj Khare

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required