You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Igal @ Lucee.org" <ig...@lucee.org> on 2016/10/07 19:09:20 UTC

Host appBase vs. Context docBase

Hi,

Suppose that I have an application at C:\WebApps\App1

Is it better to set it up as Host appBase (option 1) or as Context
docBase with empty path (option 2):

<!-- option 1 !-->
<Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">

</Host>

<!-- option 2 !-->
<Host name="App1" autoDeploy="false">

      <Context path=""docBase="C:\WebApps\App1" />
</Host>

Thanks,

Igal Sapir

Lucee Core Developer
Lucee.org <http://lucee.org/>


Re: Setting up a Context outside of webapps

Posted by "Igal @ Lucee.org" <ig...@lucee.org>.
Hi,

On 10/21/2016 10:51 AM, Mark Eggers wrote:
> 1. Create separate Host entries for each host that you wish to serve.
>     See:
>
> http://tomcat.apache.org/tomcat-8.5-doc/virtual-hosting-howto.html
This shows how to have separate xml files for the different hosts, which 
is not what I am asking about

> 2. Name your WAR file ROOT.war (case is important even on Windows)
I am not using WAR files, nor do I want to be limited to name it 
according to convention, i.e. ROOT.war

> There are a lot of examples - here's an old one:
>
> http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

Those examples use webapps container directory (regardless of whether 
it's $CATALINA_BASE/webapps or in a different path.

Again, not what I'm after, and not what I'm asking about.


Igal

>
>> On 10/21/2016 1:21 AM, r.bottoni@afterbit.com wrote:
>>> Hello,
>>> did you received some real config?
>>> Roberto.
>>>    -----Messaggio originale-----
>>> Da: Igal @ Lucee.org [mailto:igal@lucee.org]
>>> Inviato: venerd 7 ottobre 2016 21:57
>>> A: Tomcat Users List <us...@tomcat.apache.org>
>>> Oggetto: Re: Host appBase vs. Context docBase
>>>
>>>> Suppose you tell us your Tomcat version.
>>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK
>>> this has
>>> not changed in years.
>>>
>>>> It is highly unlikely that you want the <Host> name to be App1
>>> Of course that my host name is not App1, that was to remove fluff and to
>>> keep only the relevant information in the email.
>>>
>>>> The path attribute of the <Context> element must not be used unless
>>>> the <Context> element is in server.xml, which it should not be
>>> I actually prefer it to be in server.xml
>>>
>>>> The docBase attribute is used only when the <Context> element is
>>>> located in conf/Catalina/[host]/[appName].xml
>>> That is definitely not true.  I've set up Tomcat many many times like
>>> this
>>> and it works.  I may have not set it up the best way, hence my question
>>> here, but the docBase attribute is indeed, used.
>>>
>>>> You need to read the documentation for <Context>, <Host>, and deployment
>>> for the Tomcat version you're using.
>>> It would have been nice to see some real life examples of complete
>>> configurations.
>>>
>>> Igal Sapir
>>> Lucee Core Developer
>>> Lucee.org <http://lucee.org/>
>>>
>>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>>>>> From: Igal @ Lucee.org [mailto:igal@lucee.org]
>>>>> Subject: Host appBase vs. Context docBase Suppose that I have an
>>>>> application at C:\WebApps\App1
>>>> Suppose you tell us your Tomcat version.
>>>>
>>>>> <!-- option 1 !-->
>>>>> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">
>>>>> </Host>
>>>>> <!-- option 2 !-->
>>>>> <Host name="App1" autoDeploy="false">
>>>>>          <Context path=""docBase="C:\WebApps\App1" /> </Host>
>>>> Both of the above are incorrect.  It is highly unlikely that you want
>>>> the
>>> <Host> name to be App1.  The appBase attribute of <Host> must point to a
>>> directory where one or more webapps are located for automatic deployment.
>>> It must never point to a specific webapp.  The path attribute of the
>>> <Context> element must not be used unless the <Context> element is in
>>> server.xml, which it should not be.  The docBase attribute is used
>>> only when
>>> the <Context> element is located in conf/Catalina/[host]/[appName].xml.
>>>> You need to read the documentation for <Context>, <Host>, and deployment
>>> for the Tomcat version you're using.
>>>>     - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>


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


Re: Setting up a Context outside of webapps

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
Replying inline and at the end of the most recently posted message:

On 10/21/2016 10:31 AM, Igal @ Lucee.org wrote:
> I'm asking my question differently since it didn't get much traction
> when I asked it before.
> 
> I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g.
> at C:\WebRoot\myapp.  I prefer to configure it in server.xml, because I
> like it that all of my config files are at %CATALINA_BASE%/conf.
> 
> So for example, to set up an app for myapp.tld, with contents in
> C:\WebRoot\myapp, I use the following snippet:
> 
> <Host name="myapp.tld" autoDeploy="false">
>     <Context path="" docBase="C:\WebRoot\myapp" />
> </Host>
> 
> I don't want to specify Host appBase to C:\WebRoot because it contains
> separate sites (Contexts) in different directories, and each site is
> configured to run at the root directory of the site, e.g.
> http://myapp.tld/.  I also clear the contents of %CATALINA_BASE%/webapps.
> 
> Is that the right way to do it?  Is there a better way?  Anything wrong
> with this set up?

1. In my opinion, no
2. In my opinion, yes
3. Read the docs concerning docBase, appBase, and ROOT.war

> 
> It'd be great if the docs had contained some real examples.
> 
> Thanks,
> 
> Igal Sapir
> Lucee Core Developer
> Lucee.org <http://lucee.org/>
> 

1. Create separate Host entries for each host that you wish to serve.
   See:

http://tomcat.apache.org/tomcat-8.5-doc/virtual-hosting-howto.html

2. Name your WAR file ROOT.war (case is important even on Windows)

3. Navigate to http://hostname/

The appropriate site will come up with the default application being
ROOT.war.

There are a lot of examples - here's an old one:

http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

One of these days I'll get around to revising, rewriting, and updating
the document for a production environment.

We use a variant of that setup with CATALINA_BASE and CATALINA_HOME for
production. It makes managing hosts and doing upgrades simple. Most of
the work can be done without taking the system offline.

. . . just my two cents
/mde/


> On 10/21/2016 1:21 AM, r.bottoni@afterbit.com wrote:
>> Hello,
>> did you received some real config?
>> Roberto.
>>   -----Messaggio originale-----
>> Da: Igal @ Lucee.org [mailto:igal@lucee.org]
>> Inviato: venerdì 7 ottobre 2016 21:57
>> A: Tomcat Users List <us...@tomcat.apache.org>
>> Oggetto: Re: Host appBase vs. Context docBase
>>
>>> Suppose you tell us your Tomcat version.
>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK
>> this has
>> not changed in years.
>>
>>> It is highly unlikely that you want the <Host> name to be App1
>> Of course that my host name is not App1, that was to remove fluff and to
>> keep only the relevant information in the email.
>>
>>> The path attribute of the <Context> element must not be used unless
>>> the <Context> element is in server.xml, which it should not be
>> I actually prefer it to be in server.xml
>>
>>> The docBase attribute is used only when the <Context> element is
>>> located in conf/Catalina/[host]/[appName].xml
>> That is definitely not true.  I've set up Tomcat many many times like
>> this
>> and it works.  I may have not set it up the best way, hence my question
>> here, but the docBase attribute is indeed, used.
>>
>>> You need to read the documentation for <Context>, <Host>, and deployment
>> for the Tomcat version you're using.
>> It would have been nice to see some real life examples of complete
>> configurations.
>>
>> Igal Sapir
>> Lucee Core Developer
>> Lucee.org <http://lucee.org/>
>>
>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>>>> From: Igal @ Lucee.org [mailto:igal@lucee.org]
>>>> Subject: Host appBase vs. Context docBase Suppose that I have an
>>>> application at C:\WebApps\App1
>>> Suppose you tell us your Tomcat version.
>>>
>>>> <!-- option 1 !-->
>>>> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">
>>>> </Host>
>>>> <!-- option 2 !-->
>>>> <Host name="App1" autoDeploy="false">
>>>>         <Context path=""docBase="C:\WebApps\App1" /> </Host>
>>> Both of the above are incorrect.  It is highly unlikely that you want
>>> the
>> <Host> name to be App1.  The appBase attribute of <Host> must point to a
>> directory where one or more webapps are located for automatic deployment.
>> It must never point to a specific webapp.  The path attribute of the
>> <Context> element must not be used unless the <Context> element is in
>> server.xml, which it should not be.  The docBase attribute is used
>> only when
>> the <Context> element is located in conf/Catalina/[host]/[appName].xml.
>>> You need to read the documentation for <Context>, <Host>, and deployment
>> for the Tomcat version you're using.
>>>    - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
> 
> 



Re: Setting up a Context outside of webapps

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Igal,

On 10/21/16 3:41 PM, Igal @ Lucee.org wrote:
> Chris,
> 
> On 10/21/2016 12:03 PM, Christopher Schultz wrote:
>> I'm not sure anyone else's opinion matters at this point. You've 
>> decided what you want to do... you're just looking for
>> validation. Technically, this works. Whether there are better
>> ways to do it are debatable.
> I've been running Tomcat for almost 10 years now, and this works
> for me well, having separate directory trees for software, config
> files, and web documents.
> 
> So yes, I've decided what I want to do.  But I want to make sure
> that there are no unintended consequences of which I'm unaware.

I don't believe there are any untended consequences of doing what
you're doing, other than the caveat that you have to bounce Tomcat to
make any changes.

>> But you're not interested in anyone else's opinon, so why bother
>> asking?
> That's because I'm not looking for an opinion of users who've found
> some config files online and copied/pasted them to their server.
> I'm looking for an opinion of someone who knows the inner workings
> of Tomcat, e.g. someone from the core team members.
> 
> So far no one has shown me how they set up Tomcat in a directory
> outside of $CATALINA_BASE.  The few "opinions" that I received say
> that my web directories should reside inside
> $CATALINA_BASE/webapps, which as you stated -- I've already decided
> that is not what I want.

If you want applications deployed outside of the appBase, then the
best way IMO is to drop your application.xml into
conf/[service]/[host]/[appname].xml. Point the docbase anywhere you
please.

>> How many different ways are there to demonstrate:
>> 
>> <Host> <Context /> </Host>
>> 
>> ??
> How exactly does that show how to specify where the web root will
> be, and have it outside of $CATALINA_BASE/webapps?

I'm sorry, that reference was for a few lines below what you're asking
here. This is the one you want, now:

http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

It says pretty clearly: the docbase identifies where your files are,
and the name of the XML file defines the URL mount-point.

> My question, at least the 2nd time around, is in my opinion very
> clear and very valid.  It'd be really great if someone can provide
> a real answer rather than post a couple of links to the docs (I
> have access to google too), or tell me that I'm just "doing it
> wrong".

Okay: you're doing it wrong and instead you should do what I've
outlined above and is detailed in Tomcat's configuration reference:
put your application's XML file in conf/[service]/[host]/[appname].xml
and put your bite wherever the heck you want.

The only difference between what I'm recommending and what you are
doing is the location of the <Context>: I recommend a separate file,
and you like server.xml. They will both work. There are advantages to
each, and I suspect you know what they are. I happen to like the
advantages of my recommendation over your current deployment and I've
explained what those advantages are. If you don't think it's worth the
trouble, don't change anything.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCoBRAAoJEBzwKT+lPKRYxoUQAJoKQy/+XrIeEIWQpVQBCtOZ
JkLBKsme5GSXEYlnB/qhBWjnMeGbK5NP4Fq3XpMLnJzCPtEhNMuhsf0ONld2YPQN
XEN2s1lA+LedNbg83RrsXWXupR+G5rbx0LwxO8sdAl8qHkYMUad0DMTx54EPzBZB
CeeRSEa251Ty3owaw+DZNQrVN6GFKLf1HnM29KUghVSvjtk17W79Fq6nVsLEvmt4
oRtZ/Oc+k7dXB7EAqwQEi7sCHk/1qcCW8nnI52enrQMuFvp9obTj3z1AcZs2EbPI
RAr9FY5qoVp/GcV6Z0YyPkgTkNEBTkYbB/hgJq+ELbmVJ9WFKjSy+04f8yEhLM3T
rjD53UwguuTAL6uO3wfyrWIgLZM0at+oDdXSB2ieos0Sq++/Nd7MBcTkLhH1ljBr
zDNscvg7kVDU9UJ2WQeziGynST8vfJ8JySF1VYXjhqNS3O4dRtoP/EK63IrbXRJb
iruokzzMMm8lWoxtnl297VWUwcGcV6m3E/MQkRCxvuC76ndVwXbTL/kkLhKcz5AN
HkSvMxO0ZSwuKSYUAxA413a9w4Gys9R9TeOwtQrPB9LMzpMj4dlziGgTQNHWf5eE
8QRQA12SFGGSu3nqhyyueZgcrGUotS27exC7Cfv+6ggLGLjg+yIvRCWjFbcLphdm
cSyT7BSR+kGOkBO77wF5
=lhEp
-----END PGP SIGNATURE-----

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


Re: Setting up a Context outside of webapps

Posted by "Igal @ Lucee.org" <ig...@lucee.org>.
Chris,

On 10/21/2016 12:03 PM, Christopher Schultz wrote:
> I'm not sure anyone else's opinion matters at this point. You've
> decided what you want to do... you're just looking for validation.
> Technically, this works. Whether there are better ways to do it are
> debatable.
I've been running Tomcat for almost 10 years now, and this works for me 
well, having separate directory trees for software, config files, and 
web documents.

So yes, I've decided what I want to do.  But I want to make sure that 
there are no unintended consequences of which I'm unaware.

> But you're not interested in anyone else's opinon, so why
> bother asking?
That's because I'm not looking for an opinion of users who've found some 
config files online and copied/pasted them to their server. I'm looking 
for an opinion of someone who knows the inner workings of Tomcat, e.g. 
someone from the core team members.

So far no one has shown me how they set up Tomcat in a directory outside 
of $CATALINA_BASE.  The few "opinions" that I received say that my web 
directories should reside inside $CATALINA_BASE/webapps, which as you 
stated -- I've already decided that is not what I want.

> How many different ways are there to demonstrate:
>
> <Host>
>    <Context />
> </Host>
>
> ??
How exactly does that show how to specify where the web root will be, 
and have it outside of $CATALINA_BASE/webapps?

My question, at least the 2nd time around, is in my opinion very clear 
and very valid.  It'd be really great if someone can provide a real 
answer rather than post a couple of links to the docs (I have access to 
google too), or tell me that I'm just "doing it wrong".

Sincerely,


Igal


> There is a description of all the ways to define a context here:
> https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Defining_a_
> context
>
> The files go where the files go. The contents are not terribly
> relevant. What kind of example were you looking for?
>
> - -chris
>
>> On 10/21/2016 1:21 AM, r.bottoni@afterbit.com wrote:
>>> Hello, did you received some real config? Roberto. -----Messaggio
>>> originale----- Da: Igal @ Lucee.org [mailto:igal@lucee.org]
>>> Inviato: venerd� 7 ottobre 2016 21:57 A: Tomcat Users List
>>> <us...@tomcat.apache.org> Oggetto: Re: Host appBase vs. Context
>>> docBase
>>>
>>>> Suppose you tell us your Tomcat version.
>>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since
>>> AFAIK this has not changed in years.
>>>
>>>> It is highly unlikely that you want the <Host> name to be App1
>>> Of course that my host name is not App1, that was to remove fluff
>>> and to keep only the relevant information in the email.
>>>
>>>> The path attribute of the <Context> element must not be used
>>>> unless the <Context> element is in server.xml, which it should
>>>> not be
>>> I actually prefer it to be in server.xml
>>>
>>>> The docBase attribute is used only when the <Context> element
>>>> is located in conf/Catalina/[host]/[appName].xml
>>> That is definitely not true.  I've set up Tomcat many many times
>>> like this and it works.  I may have not set it up the best way,
>>> hence my question here, but the docBase attribute is indeed,
>>> used.
>>>
>>>> You need to read the documentation for <Context>, <Host>, and
>>>> deployment
>>> for the Tomcat version you're using. It would have been nice to
>>> see some real life examples of complete configurations.
>>>
>>> Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/>
>>>
>>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>>>>> From: Igal @ Lucee.org [mailto:igal@lucee.org] Subject: Host
>>>>> appBase vs. Context docBase Suppose that I have an
>>>>> application at C:\WebApps\App1
>>>> Suppose you tell us your Tomcat version.
>>>>
>>>>> <!-- option 1 !--> <Host name="App1"appBase="C:\WebApps\App1"
>>>>> autoDeploy="false"> </Host> <!-- option 2 !--> <Host
>>>>> name="App1" autoDeploy="false"> <Context
>>>>> path=""docBase="C:\WebApps\App1" /> </Host>
>>>> Both of the above are incorrect.  It is highly unlikely that
>>>> you want the
>>> <Host> name to be App1.  The appBase attribute of <Host> must
>>> point to a directory where one or more webapps are located for
>>> automatic deployment. It must never point to a specific webapp.
>>> The path attribute of the <Context> element must not be used
>>> unless the <Context> element is in server.xml, which it should
>>> not be.  The docBase attribute is used only when the <Context>
>>> element is located in conf/Catalina/[host]/[appName].xml.
>>>> You need to read the documentation for <Context>, <Host>, and
>>>> deployment
>>> for the Tomcat version you're using.
>>>> - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>
>>> ---------------------------------------------------------------------
>>>
>>>
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>
> -----BEGIN PGP SIGNATURE-----
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJYCmaZAAoJEBzwKT+lPKRYAi4P/AyKInOBGGYWGTLLPmtIuWhf
> PU2peCeV9JNnDeK1CgTWe/McSqBwJYYop6/gOuKL5wTaMTVJrHpUj9nRKIE+tMUE
> zdJ6NKHoTILFfBkgUsovI4dH3A5fcE0Lw2jFx1cz5gue+5gS2j4MvcQFHoFhIsnN
> IU1+EHo9p30zhzMBZrO21xkoxQqKcvzx3Ksn7Fc7+uCWXSEfkn7ShmDGLJDLHeBh
> 2f6kvDTyoLTYheXuYZZyCERFyfAZY9yzK0S1mhssQuJdZTt+QMVycAaX2yFXZQDC
> F7pOduMHE2F5iXe+Jz6cTC9ms+/D3NSoIoEEm/twxGIUFSci6SO4drReyn4wU7NG
> VGmftl+npp1lHhyO0z2iTQectKR8fwLPZLJvxRZOI+sSR46QPYpnqVstLWfsw0Jm
> 92XLEI+QAkkfgp8HkgDm/GGwjsUZPKbDx+aAOwm/+sVWoDWZot4lsnbuZf5V2CHD
> VLxAgfeWwyjkvyX/r0Vv4Ep8TNzP2j4Tuvy7m3gzhXJ8RhH3X0IYr2tN4mEQgQVE
> bBJAuGmHRgH6DLM95sr1MKFBbGdqeFZeqn+Nl/NuWmj5HgSiCxNfwiZtxurECO5Q
> lN9NT7kl7YMlx5kbKN/z4GkHHwSUsXjQzZXXJb+Vjtj7xtvG6H4iYld1RSMbHakf
> 3apIV3NKcIKRzlpkgnFB
> =D2pd
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: Setting up a Context outside of webapps

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Igal,

On 10/21/16 1:31 PM, Igal @ Lucee.org wrote:
> I'm asking my question differently since it didn't get much
> traction when I asked it before.
> 
> I want to set up a Web Context outside of %CATALINA_BASE%/webapps,
> e.g. at C:\WebRoot\myapp.  I prefer to configure it in server.xml,
> because I like it that all of my config files are at
> %CATALINA_BASE%/conf.
> 
> So for example, to set up an app for myapp.tld, with contents in 
> C:\WebRoot\myapp, I use the following snippet:
> 
> <Host name="myapp.tld" autoDeploy="false"> <Context path=""
> docBase="C:\WebRoot\myapp" /> </Host>
> 
> I don't want to specify Host appBase to C:\WebRoot because it
> contains separate sites (Contexts) in different directories, and
> each site is configured to run at the root directory of the site,
> e.g. http://myapp.tld/.  I also clear the contents of
> %CATALINA_BASE%/webapps.
> 
> Is that the right way to do it?  Is there a better way?  Anything
> wrong with this set up?

I'm not sure anyone else's opinion matters at this point. You've
decided what you want to do... you're just looking for validation.
Technically, this works. Whether there are better ways to do it are
debatable. But you're not interested in anyone else's opinon, so why
bother asking?

> It'd be great if the docs had contained some real examples.

How many different ways are there to demonstrate:

<Host>
  <Context />
</Host>

??

There is a description of all the ways to define a context here:
https://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Defining_a_
context

The files go where the files go. The contents are not terribly
relevant. What kind of example were you looking for?

- -chris

> On 10/21/2016 1:21 AM, r.bottoni@afterbit.com wrote:
>> Hello, did you received some real config? Roberto. -----Messaggio
>> originale----- Da: Igal @ Lucee.org [mailto:igal@lucee.org] 
>> Inviato: venerd� 7 ottobre 2016 21:57 A: Tomcat Users List
>> <us...@tomcat.apache.org> Oggetto: Re: Host appBase vs. Context
>> docBase
>> 
>>> Suppose you tell us your Tomcat version.
>> I'm using Tomcat 8.5.5 -- not sure how relevant that is since
>> AFAIK this has not changed in years.
>> 
>>> It is highly unlikely that you want the <Host> name to be App1
>> Of course that my host name is not App1, that was to remove fluff
>> and to keep only the relevant information in the email.
>> 
>>> The path attribute of the <Context> element must not be used
>>> unless the <Context> element is in server.xml, which it should
>>> not be
>> I actually prefer it to be in server.xml
>> 
>>> The docBase attribute is used only when the <Context> element
>>> is located in conf/Catalina/[host]/[appName].xml
>> That is definitely not true.  I've set up Tomcat many many times
>> like this and it works.  I may have not set it up the best way,
>> hence my question here, but the docBase attribute is indeed,
>> used.
>> 
>>> You need to read the documentation for <Context>, <Host>, and
>>> deployment
>> for the Tomcat version you're using. It would have been nice to
>> see some real life examples of complete configurations.
>> 
>> Igal Sapir Lucee Core Developer Lucee.org <http://lucee.org/>
>> 
>> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>>>> From: Igal @ Lucee.org [mailto:igal@lucee.org] Subject: Host
>>>> appBase vs. Context docBase Suppose that I have an 
>>>> application at C:\WebApps\App1
>>> Suppose you tell us your Tomcat version.
>>> 
>>>> <!-- option 1 !--> <Host name="App1"appBase="C:\WebApps\App1"
>>>> autoDeploy="false"> </Host> <!-- option 2 !--> <Host
>>>> name="App1" autoDeploy="false"> <Context
>>>> path=""docBase="C:\WebApps\App1" /> </Host>
>>> Both of the above are incorrect.  It is highly unlikely that
>>> you want the
>> <Host> name to be App1.  The appBase attribute of <Host> must
>> point to a directory where one or more webapps are located for
>> automatic deployment. It must never point to a specific webapp.
>> The path attribute of the <Context> element must not be used
>> unless the <Context> element is in server.xml, which it should
>> not be.  The docBase attribute is used only when the <Context>
>> element is located in conf/Catalina/[host]/[appName].xml.
>>> You need to read the documentation for <Context>, <Host>, and
>>> deployment
>> for the Tomcat version you're using.
>>> - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>>
>> 
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>> 
> 
> 
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJYCmaZAAoJEBzwKT+lPKRYAi4P/AyKInOBGGYWGTLLPmtIuWhf
PU2peCeV9JNnDeK1CgTWe/McSqBwJYYop6/gOuKL5wTaMTVJrHpUj9nRKIE+tMUE
zdJ6NKHoTILFfBkgUsovI4dH3A5fcE0Lw2jFx1cz5gue+5gS2j4MvcQFHoFhIsnN
IU1+EHo9p30zhzMBZrO21xkoxQqKcvzx3Ksn7Fc7+uCWXSEfkn7ShmDGLJDLHeBh
2f6kvDTyoLTYheXuYZZyCERFyfAZY9yzK0S1mhssQuJdZTt+QMVycAaX2yFXZQDC
F7pOduMHE2F5iXe+Jz6cTC9ms+/D3NSoIoEEm/twxGIUFSci6SO4drReyn4wU7NG
VGmftl+npp1lHhyO0z2iTQectKR8fwLPZLJvxRZOI+sSR46QPYpnqVstLWfsw0Jm
92XLEI+QAkkfgp8HkgDm/GGwjsUZPKbDx+aAOwm/+sVWoDWZot4lsnbuZf5V2CHD
VLxAgfeWwyjkvyX/r0Vv4Ep8TNzP2j4Tuvy7m3gzhXJ8RhH3X0IYr2tN4mEQgQVE
bBJAuGmHRgH6DLM95sr1MKFBbGdqeFZeqn+Nl/NuWmj5HgSiCxNfwiZtxurECO5Q
lN9NT7kl7YMlx5kbKN/z4GkHHwSUsXjQzZXXJb+Vjtj7xtvG6H4iYld1RSMbHakf
3apIV3NKcIKRzlpkgnFB
=D2pd
-----END PGP SIGNATURE-----

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


Setting up a Context outside of webapps (was: Host appBase vs. Context docBase)

Posted by "Igal @ Lucee.org" <ig...@lucee.org>.
I'm asking my question differently since it didn't get much traction 
when I asked it before.

I want to set up a Web Context outside of %CATALINA_BASE%/webapps, e.g. 
at C:\WebRoot\myapp.  I prefer to configure it in server.xml, because I 
like it that all of my config files are at %CATALINA_BASE%/conf.

So for example, to set up an app for myapp.tld, with contents in 
C:\WebRoot\myapp, I use the following snippet:

<Host name="myapp.tld" autoDeploy="false">
     <Context path="" docBase="C:\WebRoot\myapp" />
</Host>

I don't want to specify Host appBase to C:\WebRoot because it contains 
separate sites (Contexts) in different directories, and each site is 
configured to run at the root directory of the site, e.g. 
http://myapp.tld/.  I also clear the contents of %CATALINA_BASE%/webapps.

Is that the right way to do it?  Is there a better way?  Anything wrong 
with this set up?

It'd be great if the docs had contained some real examples.

Thanks,

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/21/2016 1:21 AM, r.bottoni@afterbit.com wrote:
> Hello,
> did you received some real config?
> Roberto.
>   
> -----Messaggio originale-----
> Da: Igal @ Lucee.org [mailto:igal@lucee.org]
> Inviato: venerd 7 ottobre 2016 21:57
> A: Tomcat Users List <us...@tomcat.apache.org>
> Oggetto: Re: Host appBase vs. Context docBase
>
>> Suppose you tell us your Tomcat version.
> I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has
> not changed in years.
>
>> It is highly unlikely that you want the <Host> name to be App1
> Of course that my host name is not App1, that was to remove fluff and to
> keep only the relevant information in the email.
>
>> The path attribute of the <Context> element must not be used unless
>> the <Context> element is in server.xml, which it should not be
> I actually prefer it to be in server.xml
>
>> The docBase attribute is used only when the <Context> element is
>> located in conf/Catalina/[host]/[appName].xml
> That is definitely not true.  I've set up Tomcat many many times like this
> and it works.  I may have not set it up the best way, hence my question
> here, but the docBase attribute is indeed, used.
>
>> You need to read the documentation for <Context>, <Host>, and deployment
> for the Tomcat version you're using.
> It would have been nice to see some real life examples of complete
> configurations.
>
> Igal Sapir
> Lucee Core Developer
> Lucee.org <http://lucee.org/>
>
> On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>>> From: Igal @ Lucee.org [mailto:igal@lucee.org]
>>> Subject: Host appBase vs. Context docBase Suppose that I have an
>>> application at C:\WebApps\App1
>> Suppose you tell us your Tomcat version.
>>
>>> <!-- option 1 !-->
>>> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">
>>> </Host>
>>> <!-- option 2 !-->
>>> <Host name="App1" autoDeploy="false">
>>>         <Context path=""docBase="C:\WebApps\App1" /> </Host>
>> Both of the above are incorrect.  It is highly unlikely that you want the
> <Host> name to be App1.  The appBase attribute of <Host> must point to a
> directory where one or more webapps are located for automatic deployment.
> It must never point to a specific webapp.  The path attribute of the
> <Context> element must not be used unless the <Context> element is in
> server.xml, which it should not be.  The docBase attribute is used only when
> the <Context> element is located in conf/Catalina/[host]/[appName].xml.
>> You need to read the documentation for <Context>, <Host>, and deployment
> for the Tomcat version you're using.
>>    - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


R: Host appBase vs. Context docBase

Posted by r....@afterbit.com.
Hello,
did you received some real config?
Roberto.
 
-----Messaggio originale-----
Da: Igal @ Lucee.org [mailto:igal@lucee.org] 
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List <us...@tomcat.apache.org>
Oggetto: Re: Host appBase vs. Context docBase

> Suppose you tell us your Tomcat version.
I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this has
not changed in years.

> It is highly unlikely that you want the <Host> name to be App1
Of course that my host name is not App1, that was to remove fluff and to
keep only the relevant information in the email.

> The path attribute of the <Context> element must not be used unless 
> the <Context> element is in server.xml, which it should not be
I actually prefer it to be in server.xml

> The docBase attribute is used only when the <Context> element is 
> located in conf/Catalina/[host]/[appName].xml
That is definitely not true.  I've set up Tomcat many many times like this
and it works.  I may have not set it up the best way, hence my question
here, but the docBase attribute is indeed, used.

> You need to read the documentation for <Context>, <Host>, and deployment
for the Tomcat version you're using.
It would have been nice to see some real life examples of complete
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>> From: Igal @ Lucee.org [mailto:igal@lucee.org]
>> Subject: Host appBase vs. Context docBase Suppose that I have an 
>> application at C:\WebApps\App1
> Suppose you tell us your Tomcat version.
>
>> <!-- option 1 !-->
>> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false"> 
>> </Host>
>> <!-- option 2 !-->
>> <Host name="App1" autoDeploy="false">
>>        <Context path=""docBase="C:\WebApps\App1" /> </Host>
> Both of the above are incorrect.  It is highly unlikely that you want the
<Host> name to be App1.  The appBase attribute of <Host> must point to a
directory where one or more webapps are located for automatic deployment.
It must never point to a specific webapp.  The path attribute of the
<Context> element must not be used unless the <Context> element is in
server.xml, which it should not be.  The docBase attribute is used only when
the <Context> element is located in conf/Catalina/[host]/[appName].xml.
>
> You need to read the documentation for <Context>, <Host>, and deployment
for the Tomcat version you're using.
>
>   - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>



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


Re: Host appBase vs. Context docBase

Posted by "Igal @ Lucee.org" <ig...@lucee.org>.
> Suppose you tell us your Tomcat version.
I'm using Tomcat 8.5.5 -- not sure how relevant that is since AFAIK this 
has not changed in years.

> It is highly unlikely that you want the <Host> name to be App1
Of course that my host name is not App1, that was to remove fluff and to 
keep only the relevant information in the email.

> The path attribute of the <Context> element must not be used unless the <Context> element is in server.xml, which it should not be
I actually prefer it to be in server.xml

> The docBase attribute is used only when the <Context> element is located in conf/Catalina/[host]/[appName].xml
That is definitely not true.  I've set up Tomcat many many times like 
this and it works.  I may have not set it up the best way, hence my 
question here, but the docBase attribute is indeed, used.

> You need to read the documentation for <Context>, <Host>, and deployment for the Tomcat version you're using.
It would have been nice to see some real life examples of complete 
configurations.

Igal Sapir
Lucee Core Developer
Lucee.org <http://lucee.org/>

On 10/7/2016 12:39 PM, Caldarale, Charles R wrote:
>> From: Igal @ Lucee.org [mailto:igal@lucee.org]
>> Subject: Host appBase vs. Context docBase
>> Suppose that I have an application at C:\WebApps\App1
> Suppose you tell us your Tomcat version.
>
>> <!-- option 1 !-->
>> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">
>> </Host>
>> <!-- option 2 !-->
>> <Host name="App1" autoDeploy="false">
>>        <Context path=""docBase="C:\WebApps\App1" />
>> </Host>
> Both of the above are incorrect.  It is highly unlikely that you want the <Host> name to be App1.  The appBase attribute of <Host> must point to a directory where one or more webapps are located for automatic deployment.  It must never point to a specific webapp.  The path attribute of the <Context> element must not be used unless the <Context> element is in server.xml, which it should not be.  The docBase attribute is used only when the <Context> element is located in conf/Catalina/[host]/[appName].xml.
>
> You need to read the documentation for <Context>, <Host>, and deployment for the Tomcat version you're using.
>
>   - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


RE: Host appBase vs. Context docBase

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Igal @ Lucee.org [mailto:igal@lucee.org] 
> Subject: Host appBase vs. Context docBase

> Suppose that I have an application at C:\WebApps\App1

Suppose you tell us your Tomcat version.

> <!-- option 1 !-->
> <Host name="App1"appBase="C:\WebApps\App1" autoDeploy="false">
> </Host>

> <!-- option 2 !-->
> <Host name="App1" autoDeploy="false">
>       <Context path=""docBase="C:\WebApps\App1" />
> </Host>

Both of the above are incorrect.  It is highly unlikely that you want the <Host> name to be App1.  The appBase attribute of <Host> must point to a directory where one or more webapps are located for automatic deployment.  It must never point to a specific webapp.  The path attribute of the <Context> element must not be used unless the <Context> element is in server.xml, which it should not be.  The docBase attribute is used only when the <Context> element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for <Context>, <Host>, and deployment for the Tomcat version you're using.

 - 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org