Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

More web apps running in root context

 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I have some problems with running two application on different domain in root context. I'm using Tomcat 5.5 on Debian Linux. See example:

I have two domains first.example.com and second.example.com. Web applications have name first and second. The goal is make these application available through addresses first.example.com and second.example.com. I don't want first.example.com/first and second.example.com/second. It isn't user friendly. My configuration in conf/server.xml:



Next, in conf/Catalina/first/first.xml:


(conf/Catalina/second/second.xml is similar).


When I make directory webapps/ROOT, it works correctly only for one of my applications. It seems stupid when your context depends on name of web application directory. There must be elegant solution for "more root context" (more ROOT directories on same Tomcat server).

Thanks for help!

MC
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try look at my post in this thread: http://www.coderanch.com/t/502161/Tomcat/Disabling-http-sitename
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for reply. I have just one question - is possible to have one project with name first (=> first.war) and get directory ROOT after "unpacking"? I followed your post, but if I make directories webapps/first and webapps/public/second I don't know how to get some like this webapps/first/ROOT and webapps/second/ROOT. My projects are unpacking from war to directory only if I place them directly into webapps directory. Not in deeper directory structure.

I think of one solution - unpack war archive somewhere in temp directory and than copy it into correct structure (before Tomcat server starting process). Or do you know about more elegant solution?


Thank you.

MC
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only two ways I can see is:

1) rename your wars to ROOT.war, and deploy them on each host
2) you need to look at the JBoss Server where it is possible to define a context path of / for each war with another name then ROOT (on each host) with the use of a jboss-web.xml in each war.
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Rene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic