1

I've searched the web (and here) and gotten 'almost' my answer, but nothing seems to work right. Basically, here is what I need: I have 2 webapps (Alpha & Beta). I have 2 A-Records on the same domain (Alpha.domain.com & Beta.domain.com). Now, as you guessed, I want to be able to have users go to alpha.domain.com and get the Alpha App (without using the subdirectory /alpha).

I have the DNS setup and pointing both A-Records to my server, but when I go to either address, I get a blank white screen (no errors, nothing).

My server.xml contains the following regarding hosts:

  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">
  </Host>

  <Host name="alpha.domain.com"  appBase="alpha"
        unpackWARs="true" autoDeploy="true">
  </Host>

  <Host name="beta.domain.com"  appBase="beta"
        unpackWARs="true" autoDeploy="true">
  </Host>

In an effort to stop confusion, I have webapps, alpha and beta folders in the Tomcat 7.0 folder (CATALINA_HOME). Currently, if I drop my WAR files in any of these folders, they do deploy...I just can't see them from the browser. I've stomped around context setup, but obviously, I'm lost. Thanks for any help!

Jeff
  • 13
  • 2
  • If you drop a war file named alpha.war in the alpha folder do you see it when you visit alpha.domain.com/alpha? – Vincent Ramdhanie Aug 25 '14 at 20:32
  • Thanks for the reply! When I drop the war file in the folder, it deploys and I can see the app if I put in alpha.domian.com/alpha. Just a blank white screen with just alpha.domain.com. – Jeff Aug 25 '14 at 20:53
  • In that case just deploy the files directly into the alpha folder rather than letting the war file unpack into a sub folder. – Vincent Ramdhanie Aug 25 '14 at 20:55
  • AH! that makes sense...now for my noob question (ok, my second noob question), how do I deploy it straight into that folder without the .war unpacking into a subfolder? I copied to contents 'up' to the 'alpha' folder, but I'm not sure how to make Tomcat aware of this. – Jeff Aug 25 '14 at 21:32
  • Can you try renaming the war file to ROOT.war before deploy and see what happens? It is also possible to edit the configuration file called ROOT.xml but see if this works first. – Vincent Ramdhanie Aug 25 '14 at 23:17
  • You are a god! that did it! Renamed alpha.war to ROOT.war and moved it into the ALPHA directory. Then did the same for Beta.war (moved to beta dir as ROOT.war). Once they deployed, it worked exactly as needed. THANKS!!!! – Jeff Aug 26 '14 at 02:12

1 Answers1

0

By default Tomcat will deploy ROOT.war to the root context of your server. So renaming your application's war file to ROOT.war will usually work.

Alternatively the context may be configured via the xml configurations such as ROOT.xml. Sometimes you want to keep the default root context so this may be the better way to go.

This question has some further details about the configuration option.

The the Tomcat Documentation itself is the best place to find guidance.

Community
  • 1
  • 1
Vincent Ramdhanie
  • 102,349
  • 23
  • 137
  • 192