File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Confused on a Higher Plane - Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Confused on a Higher Plane - Tomcat" Watch "Confused on a Higher Plane - Tomcat" New topic

Confused on a Higher Plane - Tomcat

Jaime Lannister

Joined: Mar 30, 2005
Posts: 18
I've been reading several online explanations about how to handle the server.xml file for Tomcat, and am still not sure what I'm supposed to put where in certain places.

I am using Tomcat 4.06 with Linux. To get to my site I type in http://myURLnumber/mydomainame/ (the domain is registered but isn't assigned to the new URL yet on the new server yet, hence the need to type in the URLnumber first).

The site is a name based virtual site with all the files stored under /home/virtual/site1/fst/var/www/html

The web host has apparently installed a server.xml file with all the right stuff in it except for some "fill in" parts where it says to replace things like "defaulthost" with your host name.

Right now in the "Engine" section it has the statement defaulthost = "defaulthost"
in the "Host" section is has the statements name="defaulthost", context path ="", and docBase="" I'm sorry that I couldn't just copy the section in, but this bulletin board thinks its some sort of evil code or javascript even when I take the tags out, and won't let me post it.

Anyway, I'm pretty sure that I'm supposed to replace "defaulthost" with
"mydomainame", or else "myURLnumber/mydomainame"?

From what I've read, context path may be "/", but I'm not sure, and I don't know what docBase should be. Anyone have a clue?
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211


Yeah server.xml can be a formidable beast when you start dealing it with first

Now, for most of the setups, you should be able to just add a Context element to set up your application.

Adding something like -
<Context path="the_webapp_root" docBase="<path_on_local_file_system>" debug="1">

Here is a link to the Tomcat docs page for configuring Context in server.xml


The future is here. It's just not evenly distributed yet. - William Gibson
Sonny Gill LinkedIn
I agree. Here's the link:
subject: Confused on a Higher Plane - Tomcat
It's not a secret anymore!