This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Tomcat questions concerning ROOT.xml and implications of changes to it

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Background: I'm setting up a local copy of an existing app because i need to do some modifications on it. Its a jsp site with a postgres backend. I checked the live setup and it was kind of weird for me( likely due to my lack of knowledge). I noticed that the tomcat setup there did not have any war file and has no application on webapps folder and I noticed that the ROOT.xml was modified.
the ROOT.xml was modified:
<Context docBase="/home/tomcat/app">
and so the docbase was change to a different directory. I was wondering what implications this would have?

Secondly I noticed that the tomcat i downloaded did not have a <tomcat-dir>/conf/Catalina/localhost directory; and then if I used aptitude or yum tomcat is thrown all over the place. part is in /etc and some are in /usr/shared and some in /var. I opt to manually download the tomcat and extract. On ubuntu the Catalina/localhost is on /etc/tomcat6/Catalina. So concerning this, I wish to verify what Catalina is used for and if this is the same directory as Catalina home.

I'm sorry if my questions seem a bit basic for some. I've gotten used to just using ubuntu's aptitude and just deploying wars to the webapp directory so I'm not familiar with the details of tomcat. I appreciate any help.

Best Regards, Stevenson
 
Saloon Keeper
Posts: 24334
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should find that /home/tomcat/app is what's known as an "exploded WAR". Tomcat supports running webapps whose WAR files have been unzipped, although this is not part of the J2EE spec. Despite the fact that this is a directory instead of a file, there should still be a WEB-INF subdirectory with classes and lib under it, although people have been known to create "dirty" WARs and leave these essentials out.

The stock distro for Tomcat is that everything is located under a single directory root. For people running multiple Tomcats, they can clone this structure and strip out the sharable parts and define CATALINA_HOME and CATALINA_BASE to reflect the differences.

OS packaging of Tomcat can take this one step further. A simple way to install Tomcat is to simply unzip/tar it to the /usr/local or /opt directory. But OS packages often prefer to arrange files more in accordance with the Linux filesystem standard. Which means things like not putting mutable files under /usr/local, putting config files under /etc, workfiles under /var, logfiles under /var/log and so forth. That's fine, but since Tomcat is coded for the other way, the package installers will often create these various files in their "proper" locations, and then construct softlinks from the master location to the actual location. So, for example, /usr/local/tomcat6/conf might link to /etc/tomcat6/conf, /usr/local/tomcat6/work could be /var/work/tomcat6 and so forth.

That way both the OS purists and Tomcat are happy. And, as long as you use the package manager to maintain things, no problems. If you start playing around manually with these items, however, it's best if you have good understanding of what you're doing.

In Ubuntu, the "dpkg" command will show you where things got put, I believe. In the Red Hat versions, the "rpm -qil xxxx" command will do it (substitute the package name for "xxx").

It's not actually essential that TOMCAT_HOME/conf/Catalina/localhost exist, but it does, it will be searched for deployed webapps. Also, if you're running a Tomcat with multiple hosts, there may be other deployment directories as well, but let's leave that for another day.
 
stevenson lee
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim,

Thanks for the concise reply. It helped me alot. and sorry for the late reply.

Best Regards,
Stevenson Lee
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic