Multiple applications hosting on a single Tomcat 7 instance
Once we are done with virtual hosting, a few potential problems may arise such as multiple application hosting, security, and deployment of multiple applications on a single instance of Tomcat 7. Configuration of multiple domains on one single instance of Tomcat 7 is a bit tricky. If we give the applications one document root, then all applications can be accessed by all developers. The solution is to implement a separate document root for each domain. This way, we can implement a separate security on each application that is hosted in the Tomcat instance. Let us implement the solution by creating multiple document roots in Tomcat 7. To do so, we have to edit the server.xml
to enable multiple document roots in the server, as shown in the following code snippet:
<Host name="www.xyz.com" appBase="../home/tomcatuser1">
<Context path="" docBase="/home/tomcatuser1/data"/>
<Alias>tomcatalias.com</Alias>
</Host...