You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Francis Galiegue <fg...@gmail.com> on 2008/04/08 22:44:06 UTC

Tomcat 5.5.x or 6.x: ROOT limitation removed?

Hello list,

I use Tomcat 5.0.30 as a bare bones, no fuss webapp container, with a
very, very simple server.xml:

<Server port="8005" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Connector port="8009" protocol="AJP/1.3" enableLookups="false"
      URIEncoding="UTF-8" maxProcessors="0"/>
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="external-webapps" autoDeploy="false"
        deployXML="false" unpackWARs="false">
        <Context docBase="/var/lib/tomcat5/webapps/one2team" path="">
          <!-- plus two loggers -->
        </Context>
      </Host>
    </Engine>
  </Service>
</Server>

We use mod_jk at the Apache level to communicate with the webapp.

Unfortunately, this configuration is a hack:
* the appBase in <Host> points to a non existing directory within
$CATALINA_HOME;
* the docBase of the only <Context> is an absolute path to the webapp root.

The problem is, we do _NOT_ want the webapp directory to be named
ROOT, we want it to remain one2team. And this is the only solution
I've found...

Ideally, I'd have liked to not lie to <Host> and have a ROOT.xml in
Catalina/localhost saying that no, my webapp root directory is not
named ROOT, it's one2team, thank you very much. But no, this doesn't
work.

As you can see, I also had to set autoDeploy to false, otherwise the
webapp was deployed twice: once under /, which is what we want, and
another time under /one2team, which we don't want either...

Does tomcat5.5 remove this limitation? Or even tomcat 6.x?

Thanks in advance,
-- 
Francis Galiegue, fgaliegue@gmail.com, fg@one2team.com
One2team - 42 Av. Raymond Poincaré - 75116 PARIS
"When it comes to performance, weight is everything" - Tiff Needell

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by fredk2 <fr...@gmail.com>.
Hi,

      <Host       name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
         xmlValidation="false" xmlNamespaceAware="false">

- the name is also the subdirectory as in ./conf/Engine-name/Host-name/ so
check that.
- maybe there is another attribute you set which turns off the behavior.

Fred


Francis Galiegue wrote:
> 
> 2008/4/8, fredk2 <fr...@gmail.com>:
>>
>>  Hi,
>>
>>  i do not think so, but what I did is to set an contex ROOT.xml  (not
>> sure
>>  the upper case is needed - i would think it is) and then set the docBase
>>  (relative to webapps or fully qualified) to your app eg.
>>
>>  ./conf/Catalina/localhost/ROOT.xml
>>
>>
>>  <Context docBase="${catalina.base}/mydir/myapp"
>>          privileged="true" antiResourceLocking="false"
>>  antiJARLocking="false">
>>  </Context>
>>
> 
> Hello and thanks for the quick answer.
> 
> Unfortunately, I think I've tried this but failed (the webapp wouldn't
> deploy AFAIR).
> 
> Can you show what your <Host> look like? Maybe this can make a
> difference...
> 
> Thanks,
> -- 
> Francis Galiegue, fgaliegue@gmail.com
> "When it comes to performance, weight is everything" - Tiff Needell
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-5.5.x-or-6.x%3A-ROOT-limitation-removed--tp16572902p16575433.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by Francis Galiegue <fg...@gmail.com>.
2008/4/8, fredk2 <fr...@gmail.com>:
>
>  Hi,
>
>  i do not think so, but what I did is to set an contex ROOT.xml  (not sure
>  the upper case is needed - i would think it is) and then set the docBase
>  (relative to webapps or fully qualified) to your app eg.
>
>  ./conf/Catalina/localhost/ROOT.xml
>
>
>  <Context docBase="${catalina.base}/mydir/myapp"
>          privileged="true" antiResourceLocking="false"
>  antiJARLocking="false">
>  </Context>
>

Hello and thanks for the quick answer.

Unfortunately, I think I've tried this but failed (the webapp wouldn't
deploy AFAIR).

Can you show what your <Host> look like? Maybe this can make a difference...

Thanks,
-- 
Francis Galiegue, fgaliegue@gmail.com
"When it comes to performance, weight is everything" - Tiff Needell

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by fredk2 <fr...@gmail.com>.
Hi,

i do not think so, but what I did is to set an contex ROOT.xml  (not sure
the upper case is needed - i would think it is) and then set the docBase
(relative to webapps or fully qualified) to your app eg.

./conf/Catalina/localhost/ROOT.xml


<Context docBase="${catalina.base}/mydir/myapp"
         privileged="true" antiResourceLocking="false"
antiJARLocking="false">
</Context>


Rgds
Fred


Francis Galiegue wrote:
> 
> Hello list,
> 
> I use Tomcat 5.0.30 as a bare bones, no fuss webapp container, with a
> very, very simple server.xml:
> 
> <Server port="8005" shutdown="SHUTDOWN">
>   <Service name="Catalina">
>     <Connector port="8009" protocol="AJP/1.3" enableLookups="false"
>       URIEncoding="UTF-8" maxProcessors="0"/>
>     <Engine name="Catalina" defaultHost="localhost">
>       <Host name="localhost" appBase="external-webapps" autoDeploy="false"
>         deployXML="false" unpackWARs="false">
>         <Context docBase="/var/lib/tomcat5/webapps/one2team" path="">
>           <!-- plus two loggers -->
>         </Context>
>       </Host>
>     </Engine>
>   </Service>
> </Server>
> 
> We use mod_jk at the Apache level to communicate with the webapp.
> 
> Unfortunately, this configuration is a hack:
> * the appBase in <Host> points to a non existing directory within
> $CATALINA_HOME;
> * the docBase of the only <Context> is an absolute path to the webapp
> root.
> 
> The problem is, we do _NOT_ want the webapp directory to be named
> ROOT, we want it to remain one2team. And this is the only solution
> I've found...
> 
> Ideally, I'd have liked to not lie to <Host> and have a ROOT.xml in
> Catalina/localhost saying that no, my webapp root directory is not
> named ROOT, it's one2team, thank you very much. But no, this doesn't
> work.
> 
> As you can see, I also had to set autoDeploy to false, otherwise the
> webapp was deployed twice: once under /, which is what we want, and
> another time under /one2team, which we don't want either...
> 
> Does tomcat5.5 remove this limitation? Or even tomcat 6.x?
> 
> Thanks in advance,
> -- 
> Francis Galiegue, fgaliegue@gmail.com, fg@one2team.com
> One2team - 42 Av. Raymond Poincaré - 75116 PARIS
> "When it comes to performance, weight is everything" - Tiff Needell
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat-5.5.x-or-6.x%3A-ROOT-limitation-removed--tp16572902p16573847.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by David Smith <dn...@cornell.edu>.
As you've set it up below, your webapp, one2team will be deployed 
twice.  Once as ROOT and once as one2team.  If I were in your shoes, I 
would create a folder right next to webapps and name it mywebapps or 
something.  Name isn't all that important.  Then move the one2team 
webapp in that folder and modify your ROOT.xml below, pointing it's 
docbase to the new location for one2team. 

Anything in webapps will auto-deploy with it's path = the folder name 
under webapps as long as your <Host .. > element has it as it's appBase 
pointed there.  Also I wouldn't lie about the appBase -- just point it 
to a real, empty folder.  In my suggestion above, it's still pointed to 
webapps even though there's nothing there.

--David

Francis Galiegue wrote:
> 2008/4/9, Caldarale, Charles R <Ch...@unisys.com>:
> [...]
>   
>> I've had no problems with 5.0, 5.5, and 6.0 in using a ROOT.xml file in
>>  conf/Catalina/[host] containing a <Context> element with an absolute
>>  docBase attribute pointing to the location of the webapp.  You must not
>>  use a path attribute, and you must delete the ROOT directory under the
>>  <Host> appBase, if there is one.
>>
>>     
>
> Well, this doesn't work for me :(
>
> Here is what I try in the server.xml:
>
> <Server port="8005" shutdown="SHUTDOWN">
>     <Service name="Catalina">
>         <Connector port="8009" protocol="AJP/1.3" enableLookups="false"
>             URIEncoding="UTF-8" maxProcessors="0"/>
>         <Engine name="Catalina" defaultHost="localhost">
>             <Host name="localhost" appBase="webapps" autoDeploy="false"
>                 deployXML="false" unpackWARs="false"/>
>         </Engine>
>     </Service>
> </Server>
>
> And in Catalina/localhost/ROOT.xml:
>
> <Context docBase="/var/lib/tomcat5/webapps/one2team">
>     <Valve className="org.apache.catalina.valves.AccessLogValve"
>         prefix="tomcat-access" suffix=".log" rotatable="false"
>         pattern="%a (%B bytes/%D msec) %s %r"/>
>     <Logger className="org.apache.catalina.logger.FileLogger"
>         prefix="tomcat-logger" suffix=".log" verbosity="2"
>         timestamp="false"/>
> </Context>
>
> As a Context attribute, I've tried no path as you suggested, path="",
> path="/": no luck, the webapp still deploys as /one2team...
>
> Also, if I lie about the appBase in <Host>, the application isn't
> found at all (but I guess this was to be expected after all).
>
> I've also tried the "real" appBase, changing the docBase of the
> <Context> to one2team: app deploys as /one2team, even though the
> context file is named ROOT.xml :(
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by Francis Galiegue <fg...@gmail.com>.
2008/4/9, Caldarale, Charles R <Ch...@unisys.com>:
[...]
> >
>  > Well, this doesn't work for me :(
>
> > <Context docBase="/var/lib/tomcat5/webapps/one2team">
>
> >     <Logger className="org.apache.catalina.logger.FileLogger"
>  >         prefix="tomcat-logger" suffix=".log" verbosity="2"
>  >         timestamp="false"/>
>  > </Context>
>
>
> Nor should it.  Besides the double deployment already mentioned by David
>  S, you also have a <Logger> element, which disappeared some time ago.
>  RTFM:
>  http://tomcat.apache.org/tomcat-5.5-doc/logging.html
>

Errr...

OK. I don't know if you read the original message, but I have two
loggers defined in the <Context>. I've ALWAYS had so, even when I
created my unsuccessfull Catalina/localhost/ROOT.xml. In the original
message, it says:

<!-- plus two loggers -->

The link you sent me to (BTW, I use Tomcat 5.0.30 for now which is why
I asked whether 5.5.x or 6.x "lifted" the "limitation" I'm concerned
about) doesn't indicate to my eyes in any way that my webapp would not
be able to get deployed as /. If it does, then I'm missing something
that I'd really like to be enlightened about. Seriously.

I'll recall here what the server.xml is like , with the "plus two
loggers" comment expanded to see what's really in there (remember:
Tomcat 5.0.30, and I know, it's an old dog - migration to 5.5.x is
planned very soon, hence my original mail):

----
<Server port="8005" shutdown="SHUTDOWN">
  <Service name="Catalina">
    <Connector port="8009" protocol="AJP/1.3" enableLookups="false"
      URIEncoding="UTF-8" maxProcessors="0"/>
    <Engine name="Catalina" defaultHost="localhost">
      <Host name="localhost" appBase="external-webapps" autoDeploy="false"
        deployXML="false" unpackWARs="false">
        <Context docBase="/var/lib/tomcat5/webapps/one2team" path="">
          <Valve className="org.apache.catalina.valves.AccessLogValve"
            prefix="tomcat-access" suffix=".log" rotatable="false"
            pattern="%a (%B bytes/%D msec) %s %r"/>
          <Logger className="org.apache.catalina.logger.FileLogger"
            prefix="tomcat-logger" suffix=".log" verbosity="2"
            timestamp="false"/>
        </Context>
      </Host>
    </Engine>
  </Service>
</Server>
----

This particular configuration works as I expect: the webapp is NOT a
war (and it's not even planned to be in the near future FWIW), it's
located in the Context's docBase, but then I have to lie to <Host> and
give it an appBase directory that doesn't even exist.

Sure, I'd like to do it in a cleaner way but then there are elements
over which I don't have control of - the two main of them being: the
webapp lies in a directory, and the directory has to be named
one2team...

-- 
Francis Galiegue, fgaliegue@gmail.com, fg@one2team.com, fg6@wanadoo.fr
One2team - 12bis rue de la Pierre Levée, 75011 Paris - 0143381980
"When it comes to performance, weight is everything" - Tiff Needell

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Francis Galiegue [mailto:fgaliegue@gmail.com] 
> Subject: Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?
> 
> Well, this doesn't work for me :(
> <Context docBase="/var/lib/tomcat5/webapps/one2team">
>     <Logger className="org.apache.catalina.logger.FileLogger"
>         prefix="tomcat-logger" suffix=".log" verbosity="2"
>         timestamp="false"/>
> </Context>

Nor should it.  Besides the double deployment already mentioned by David
S, you also have a <Logger> element, which disappeared some time ago.
RTFM:
http://tomcat.apache.org/tomcat-5.5-doc/logging.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by Francis Galiegue <fg...@gmail.com>.
2008/4/9, Caldarale, Charles R <Ch...@unisys.com>:
[...]
>
> I've had no problems with 5.0, 5.5, and 6.0 in using a ROOT.xml file in
>  conf/Catalina/[host] containing a <Context> element with an absolute
>  docBase attribute pointing to the location of the webapp.  You must not
>  use a path attribute, and you must delete the ROOT directory under the
>  <Host> appBase, if there is one.
>

Well, this doesn't work for me :(

Here is what I try in the server.xml:

<Server port="8005" shutdown="SHUTDOWN">
    <Service name="Catalina">
        <Connector port="8009" protocol="AJP/1.3" enableLookups="false"
            URIEncoding="UTF-8" maxProcessors="0"/>
        <Engine name="Catalina" defaultHost="localhost">
            <Host name="localhost" appBase="webapps" autoDeploy="false"
                deployXML="false" unpackWARs="false"/>
        </Engine>
    </Service>
</Server>

And in Catalina/localhost/ROOT.xml:

<Context docBase="/var/lib/tomcat5/webapps/one2team">
    <Valve className="org.apache.catalina.valves.AccessLogValve"
        prefix="tomcat-access" suffix=".log" rotatable="false"
        pattern="%a (%B bytes/%D msec) %s %r"/>
    <Logger className="org.apache.catalina.logger.FileLogger"
        prefix="tomcat-logger" suffix=".log" verbosity="2"
        timestamp="false"/>
</Context>

As a Context attribute, I've tried no path as you suggested, path="",
path="/": no luck, the webapp still deploys as /one2team...

Also, if I lie about the appBase in <Host>, the application isn't
found at all (but I guess this was to be expected after all).

I've also tried the "real" appBase, changing the docBase of the
<Context> to one2team: app deploys as /one2team, even though the
context file is named ROOT.xml :(

-- 
Francis Galiegue, fgaliegue@gmail.com, fg@one2team.com, fg6@wanadoo.fr
One2team - 12bis rue de la Pierre Levée, 75011 Paris - 0143381980
"When it comes to performance, weight is everything" - Tiff Needell

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Tomcat 5.5.x or 6.x: ROOT limitation removed?

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Francis Galiegue [mailto:fgaliegue@gmail.com] 
> Subject: Tomcat 5.5.x or 6.x: ROOT limitation removed?
> 
> The problem is, we do _NOT_ want the webapp directory to be named
> ROOT, we want it to remain one2team.

I've had no problems with 5.0, 5.5, and 6.0 in using a ROOT.xml file in
conf/Catalina/[host] containing a <Context> element with an absolute
docBase attribute pointing to the location of the webapp.  You must not
use a path attribute, and you must delete the ROOT directory under the
<Host> appBase, if there is one.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org