Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with multiple contexts for a webapp  RSS feed

Jeremy Muchler
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been trying to get multiple context names to link to a single webapp (without running multiple copies of the application itself).

I have a deployed webapp running on a Tomcat server. If you go to the URL, it works (which is great). Say the URL is What we are trying to do is to be able to have run the webapp and keep a reference to the custom url (so that all the pages will have etc in the address bar). Total we will have at least a dozen different names pointing at the same web app. Because the application itself is rather memory intensive, we are trying to avoid running multiple copies of the app. Because of decisions from the marketing team, we can't use sub-domains of the name so I haven't investigated using virtual hosts.

I was able to setup the contexts so that they work by adding them to the server.xml file, but I ran into issues with the web app trying to cache itself four times (three contexts, plus the "real" name) which would cause the server to grind to a halt and the catalina.out to throw tons of errors. I have tried to setup context files in /webapps/ and in the Meta-INF folder of the webapp itself, but either the web app would fail to load because of a malformed context file, or in the catalina logs i would see where the entries were being ignored (due to setting a path that is already within the app path).

I am not opposed to putting in the work to setup Apache+Tomcat if necessary. We haven't done so to date because this web server only runs the webapp and nothing else.

Any ideas on how to get this craziness to work?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!