tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dmitri Colebatch <>
Subject Re: Virtual Host Confusion
Date Thu, 02 Aug 2001 22:53:00 GMT

what are you trying to achieve here?  There are two things about this
that strike me as odd:

1. in httpd.conf you have ServerName, whilst in
server.xml you have host name="" - as I understand it
these should be the same name.

2. the DocumentRoot you have for apache should contain all your static
files.  the docBase for tomcat however is completely different.  Perhaps
appBase would be a better name for the attribute.  That directory should
contain your WEB-INF directory, along with its contents, and quite
possibly jsp and other files that are used by the application.  However
- I wouldn't see them as being the same directory, but I support there
is no reason why they couldn't be.  If you are going that way, make sure
you prevent ppl accessing /WEB-INF directly through apache.


Robert Schmid wrote:
> I swear I've read the documentation!  I have Virtual Hosts Contexts defined;
> Server.xml
>      <Host
> name="">
>      <Context path="" docBase="/home/net/foobar/htdocs"
> debug="0"/>
>      </Host>
>      <Host
> name="">
>      <Context path="" docBase="/home/com/barfoo/htdocs" debug="0"/>
>      </Host>
> httpd.conf:
> <VirtualHost>
>      ServerName
>      JkMount /*.jsp ajp13
>      JkMount /*.xml ajp13
>      JkMount /servlet/* ajp13
>      AddType text/xml .xml
>      DocumentRoot /home/net/foobar/htdocs
> ...
>      <Directory "/home/net/foobar/htdocs/">
>          Options All
>          AllowOverride Authconfig
>      </Directory>
> I want to be able to put xml files and jsp in the main directory or at
> least in a directory  entirely controlled by foobar.
> Is the docBase relative to $TOMCAT_HOME or is it an absolute path?
> What is appBase?  Does this work in Tomcat 3.x or only in 4.x?
> Do I need to run separate instances of Tomcat for each virtual host?
> Do I have to have a webapps directory in each Virtual Host. How about a
> WEB-INF and a web.xml directory in each directory?
> The documentation seems out of date especially the links regarding web.xml.
> Help is greatly appreciated!

View raw message