Robert Charbonneau wrote:
It's not working as the root of the tomcat server on port 8080, but I wasn't expecting it to. I want the root of the domain being able to serve JSPs and Servlets so I don't have to create a subdirectory off of the root for this purpose.

That won't work. You must create a subdirectory. All webapps live in directories, that's just how it works.


The root context looks like this:

<Context path="" docBase="someDir">
</Context>

Here's how I do it (YMMV).

URL= http://some.domain.com

<Host name="some.domain.com" appBase="some.domain.com">
  <Context path="" docBase="some.domain.com">
   ....
  </Context>
</Host>

Then index.jsp goes in $CATALINA_HOME/some.host.com/some.host.com. A little redundant, but for me it is a good reminder. So you end up with:

$CATALINA_HOME
$CATALINA_HOME/some.domain.com
$CATALINA_HOME/some.domain.com/some.domain.com
$CATALINA_HOME/some.domain.com/some.domain.com/index.jsp
$CATALINA_HOME/some.domain.com/some.domain.com/WEB-INF
$CATALINA_HOME/some.domain.com/some.domain.com/WEB-INF/web.xml
$CATALINA_HOME/some.domain.com/some.domain.com/WEB-INF/classes
$CATALINA_HOME/some.domain.com/some.domain.com/WEB-INF/lib

This lets other webapps in the same Host node be subdirs without confusing things.

As shown in server.xml, you can also follow the convention of naming the docBase of the root webapp "ROOT", in which case index.jsp would go in $CATALINA_HOME/some.domain.com/ROOT and you would have something like:

$CATALINA_HOME
$CATALINA_HOME/some.domain.com
$CATALINA_HOME/some.domain.com/ROOT
$CATALINA_HOME/some.domain.com/ROOT/index.jsp
$CATALINA_HOME/some.domain.com/ROOT/WEB-INF
$CATALINA_HOME/some.domain.com/ROOT/WEB-INF/web.xml
$CATALINA_HOME/some.domain.com/ROOT/WEB-INF/classes
$CATALINA_HOME/some.domain.com/ROOT/WEB-INF/lib

Remember that the actual directory name is transparent to the user...the only person who will ever know that something is in a subdir is the administrator. Users can still get to http://some.domain.com/whatever.jsp.

Once you have that set up, you can add <welcome-file></welcome-file> to your web.xml file and set it to index.jsp, and turn off directory listings as well.

Also try path="", not path="/" for your Context.

Sorry about that, most mailing lists I belong to are pretty free form. I'll keep an eye on the amount of data sent in the future.

We're pretty casual here as well...we just see the same files posted over and over (server.xml, httpd.conf, etc), so scrolling through 200 lines that aren't changed from the default and checking every line to see if its the same as the default or not is pretty tedious.


John



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to