4

I am not clear on the following:
If we have a web application named: SomeWebApp under Tomcat's webapp directory, the url to access it is:
http://localhost:8080/SomeWebApp
My question is, is it possible to configure Tomcat so that other URLs would point to that web application?
E.g.
http://localhost:8080/ADifferentApp will also point to the SomeWebApp?

From the web.xml I think is not possible since it is about the url patterns when you are inside the SomeWebApp scope.

So what is the proper way to do it? If it is possible that is.

Cratylus
  • 52,998
  • 69
  • 209
  • 339
  • maybe you can find the answer here: http://stackoverflow.com/questions/5875413/separating-war-application-name-from-war-file-name/ – OhadR Nov 09 '15 at 12:10

3 Answers3

2

The approach I found to work best is to install Apache2 on the server and proxy all requests. Tomcat is surprisingly difficult to configure in other ways than intended. In my experience, Tomcat doesn't provide this functionality declaratively.

Johan Sjöberg
  • 47,929
  • 21
  • 130
  • 148
0

Yes,its possible to map different context path to single application edit conf/server.xml file

> **> <Context docBase="D:\Servers\apache-tomcat-7\webapps\SomeWebApp"
> > path="/SomeWebApp" />
> >     <Context docBase="D:\Servers\apache-tomcat-7\webapps\SomeWebApp" path="/ADifferentApp "/>**

Access application with 2 URL's

0

I'd rather recommend Nginx than Apache as proxy. I'm recently working on a project that incorporates tomcat and nginx works as proxy. Once you've got nginx you can acctualy map as many url's to access the same web application as you want.

Stugal
  • 850
  • 1
  • 8
  • 24