Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

More web apps running in root context

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try look at my post in this thread: https://coderanch.com/t/502161/Tomcat/Disabling-http-sitename
 
Mike Cobelmach
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much Rene.
reply
    Bookmark Topic Watch Topic
  • New Topic