This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 21 Developer Study Guide: Exam 1Z0-830 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
  • 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:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

UnpackWAR

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm pretty sure there is a simple answer to this but I've exhausted every possibility I can think of apart from 'manual'

Situation
I have a domain - www.mydomain.com

I want to base my webapp - /dir/dir/webapps/MyWebApp

at that domain so I created a new host in the Tomcats server.xml

<Host name="www.mydomain.com" unpackWARs="true" appBase="/dir/dir/webapps/MyWebApp">
<Context path=""
docBase="."
</Context>
</Host>

It works - apart from of course I upload my MyWebApp.war to the /dir/dir/webapps/ directory - which does not get picked up by the auto unpack.

I can create an extra dummy host pointing at /dir/dir/webapps/ as the appBase which does the unpack but then 2 instances of MyWebApp are launched and I get a thread nightmare.

I tried moving the MyWebApp.war to /dir/dir/webapps/MyWebApp/ that unpacks but then of course I have my app running in /dir/dir/webapps/MyWebApp/MyWebApp/ ?!

I tried manipulating the docbase in the context.

All to no avail - so now I just manually unpack the war each time I change anything.

Is there a simple answer for a frustrated tomcat newb ?

Cheers
Scott
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that instance of Tomcat serving other hosts besides yours?
If not, there was no need to create a new Host entry.

If you want your app to be the root app, replace the tomcat/webpps/ROOT directory with your own.
 
When I was younger I felt like a man trapped inside a woman’s body. Then I was born. My twin is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic