aspose file tools*
The moose likes Tomcat and the fly likes More web apps running in root context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "More web apps running in root context" Watch "More web apps running in root context" New topic
Author

More web apps running in root context

Mike Cobelmach
Greenhorn

Joined: Jun 17, 2009
Posts: 19
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

Joined: Oct 12, 2001
Posts: 1179

Try look at my post in this thread: http://www.coderanch.com/t/502161/Tomcat/Disabling-http-sitename


Regards, Rene Larsen
Dropbox Invite
Mike Cobelmach
Greenhorn

Joined: Jun 17, 2009
Posts: 19
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

Joined: Oct 12, 2001
Posts: 1179

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

Joined: Jun 17, 2009
Posts: 19
Thank you very much Rene.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: More web apps running in root context
 
Similar Threads
How to configure tomcat to map fxbird.com to localhost:8080/myweb on tomcat 5.5 server?
How to configure two applications on different ports...?
Virtual Hosting on Tomcat 7 - always route to the default host
What is Tomcat virtual host, What is different from the Apache Tomcat?
how to remove the port number in URL