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).
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?
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.