Server Setup is laid out in the following pic:
For the sake of this discussion, let's assume we have these WAR applications deployed in Tomcat server (besides ROOT and manager default applications):
* users.war -> tomcat context /users
* webapp.war -> tomcat context /webapp
* discovery.war -> tomcat context /discovery
* bingo.war -> tomcat context /bingo
* clubs.war -> tomcat context /clubs
Just do a full reverse proxy from the Apache Server to the Tomcat Server (you could either use AJP or HTTP connectors for that purpose).
Apache Configuration will be something like this:
This is very easy to use and setup. It just takes to add these lines to a virtual host and done!
You could access the tomcat Applications to the following URLs:
The problem with this approach is:
a. You have access to ALL APPLICATIONS (even if you don't want to)
b. You have access to default applications (if they're not removed) such as Tomcat's ROOT and Manager.
Do one reverse proxy location for each application you want to expose. Let's say you want to expose `users`, `webapp` and `clubs`. Your configuration will be something like this:
The problem with this approach is obvious:
a. If you deployed 25 WARs in your tomcat and want to expose 18 of them, your Apache configuration will grow, and will become harder to maintain.
b. COPY+PASTE error might occur more frequently when adding new applications
c. If your Location sections contains more configuration options (RequestHeader directives, Require, Auth Type) then your COPY+PASTE gets bigger every time, and if you need to change/add something, you will need to do it in every single configuration you have done before.
My favorite option nowadays.
If you want the three same applications exposed, you can use LocationMatch and ProxyPassMatch directives to get the best of both previous options:
You use a regular expression to filter what domains will go through to tomcat server, and you keep it only in one configuration.