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

2016-10-21 Thread Igal @ 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:






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.bott...@afterbit.com wrote:

Hello,
did you received some real config?
Roberto.
  
-Messaggio originale-

Da: Igal @ Lucee.org [mailto:i...@lucee.org]
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List <users@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  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  element must not be used unless
the  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  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 , , 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:i...@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.







 

Both of the above are incorrect.  It is highly unlikely that you want the

 name to be App1.  The appBase attribute of  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
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used only when
the  element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




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





R: Host appBase vs. Context docBase

2016-10-21 Thread r.bottoni
Hello,
did you received some real config?
Roberto.
 
-Messaggio originale-
Da: Igal @ Lucee.org [mailto:i...@lucee.org] 
Inviato: venerdì 7 ottobre 2016 21:57
A: Tomcat Users List <users@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  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  element must not be used unless 
> the  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  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 , , 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:i...@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.
>
>> 
>>  
>> 
>> 
>> 
>> 
> Both of the above are incorrect.  It is highly unlikely that you want the
 name to be App1.  The appBase attribute of  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
 element must not be used unless the  element is in
server.xml, which it should not be.  The docBase attribute is used only when
the  element is located in conf/Catalina/[host]/[appName].xml.
>
> You need to read the documentation for , , 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-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>



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



Re: Host appBase vs. Context docBase

2016-10-07 Thread Igal @ 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  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  element must not be used unless the 
 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  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 , , 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:i...@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.







   


Both of the above are incorrect.  It is highly unlikely that you want the  name to be App1.  The 
appBase attribute of  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  
element must not be used unless the  element is in server.xml, which it should not be.  The 
docBase attribute is used only when the  element is located in 
conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





RE: Host appBase vs. Context docBase

2016-10-07 Thread Caldarale, Charles R
> From: Igal @ Lucee.org [mailto:i...@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.

> 
> 
> 

> 
> 
>   
> 

Both of the above are incorrect.  It is highly unlikely that you want the 
 name to be App1.  The appBase attribute of  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  
element must not be used unless the  element is in server.xml, which 
it should not be.  The docBase attribute is used only when the  
element is located in conf/Catalina/[host]/[appName].xml.

You need to read the documentation for , , 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Host appBase vs. Context docBase

2016-10-07 Thread Igal @ Lucee.org

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):









 


Thanks,

Igal Sapir

Lucee Core Developer
Lucee.org 



RE: Host appBase vs Context docBase

2014-07-16 Thread Jeffrey Janner
-Original Message-
From: Igal @ getRailo.org [mailto:i...@getrailo.org] 
Sent: Friday, July 04, 2014 9:05 PM
To: Tomcat Users List
Subject: Host appBase vs Context docBase

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a base 
directory for websites.  What I've been doing so far is create an empty 
folder alongside webapps, named empty, and use it as appBase, e.g.

Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false
   !-- this works but what's the deal with appBase? !--
   Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, but 
it doesn't:

Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false
   !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that is 
the way it should be, then what is the purpose of Host/appBase?

TIA

-- 
Igal Sapir
Railo Core Developer
http://getRailo.org/

Igal -
For the way you want to configure your setup, your original configuration will 
work, except that you need to change the path from / to .
That's kind of the one thing bothered me from the beginning: if you wanted a 
named path, like virtdir you have to specify it with a leading slash, 
/virtdir but for the ROOT you don't specify it. Seemed like an inconsistent 
treatment to me.
That said, I'd really recommend following current practices and moving the 
Context element to its own file under the conf/engine_name/host_name 
directory structure.  For one, you don't have to worry about that path 
parameter ever again. The name of the XML file becomes the path value, with the 
exception of needing to name the file ROOT.xml to get the null path. Also, this 
allows you to store the file under the META-INF directory of your application 
and maintain the information there and have it copied to the correct place on 
deployment.  Read the docs for more info.
Here's how to remember the difference between appbase and docbase:  The appbase 
is the path to a directory where the applications for the host reside.  Any 
directory or war file stored there will be deployed under the host.
The docbase is the path to the directory containing the files for a specific 
application.  If it is a relative path, the directory is expected to reside 
under the appbase (take care to avoid double-deployment).  If it is a 
fully-qualified path, then the appbase value is ignored. 
It is possible to mix the two, but you need to be careful if you attempt that. 
Creating a new directory for each host is a good idea, even if they are empty.
If I were you, I'd really look at moving to the current configuration 
mechanism.  After you get used to it, you'll see it makes a lot more sense.  As 
an added plus, any change you make to the context can take effect without 
having to restart the entire Tomcat service.
Jeff



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



Re: Host appBase vs Context docBase

2014-07-07 Thread Terence M. Bandoian

On 7/5/2014 1:38 PM, Igal @ getRailo.org wrote:

What version of Tomcat are you using?

I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8.

it is recommended that Context elements not be placed directly in 
server.xml
I know, but it is much easier for me to edit a single file, server.xml 
then deploy all the other files.  I'm looking to keep the deployment 
process as simple as possible.


you shouldn't need the empty directory. I've used an absolute path 
for the Host appBase attribute with relative paths for Context 
docBase attributes in Tomcat 6 and 7 without any problems.
when I try that then webapps is used by default.  if a request is 
made for a file that exists in webapps, e.g. index.jsp and does not 
exist in my application's folder, then it is served from webapps and I 
don't want that.


are you sure you want / for the Context path attribute in the 
first example above?
it was my understanding that  and / are the same here.  / reads 
more clearly to me as the root directory so I prefer to use that.


*after reading your email and testing it, however, I noticed that if I 
omit the Host/appBase and use an empty-string for the 
Context/docBase/path it works as intended, so maybe that's what I was 
doing wrong?  is that the best practice?*


Host name=Site1 unpackWARs=false autoDeploy=false
  Context path= docBase=D:/www/site1 /
  Context path=/virtualdir docBase=D:/www/shared/virtualdir /
/Host

?

thank you both for your responses,


Igal


On 7/5/2014 9:48 AM, Terence M. Bandoian wrote:

On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote:

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a 
base directory for websites.  What I've been doing so far is create 
an empty folder alongside webapps, named empty, and use it as 
appBase, e.g.


Host name=Site1 appBase=empty unpackWARs=false 
autoDeploy=false

  !-- this works but what's the deal with appBase? !--
  Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, 
but it doesn't:


Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false

  !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that 
is the way it should be, then what is the purpose of Host/appBase?


TIA



Hi, Igal-

What version of Tomcat are you using?  Also, it is recommended that 
Context elements not be placed directly in server.xml.  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context 



That said, you shouldn't need the empty directory.  I've used an 
absolute path for the Host appBase attribute with relative paths 
for Context docBase attributes in Tomcat 6 and 7 without any 
problems.  I haven't tried it with absolute paths for both appBase 
and docBase.


Lastly, are you sure you want / for the Context path attribute in 
the first example above?  The Context path for the default web 
application of a Host should be an empty string ().  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes 



-Terence Bandoian


Hi, Igal-

Glad you were able to get it working.  Please note the warning in the 
Tomcat docs about using the Context path attribute that reads:


Even when statically defining a Context in server.xml, this attribute 
must not be set unless either the docBase is not located under the 
Host's appBase or both deployOnStartup and autoDeploy are false. If this 
rule is not followed, double deployment is likely to result.


This is included in:

http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Common_Attributes

For information about about how context paths relate to WAR file names 
and application directory names, see:


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

In particular, please note that If the context path is the empty string 
them the base name will be ROOT (always in upper case)


The recommended practice is to create separate context XML files and 
package them in the application WAR files.  However, for simple 
installations, I've had success with something like:


  Host name=Host
  appBase=c:/webapps
  autoDeploy=false
  deployOnStartup=true
  unpackWARs=true

Context path= docBase=ROOT /

  /Host

The [Tomcat]/webapps directory may then be deleted (if you don't need 
the packaged apps or doc) and ROOT.war placed directly in c:/webapps.


-Terence Bandoian


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



Re: Host appBase vs Context docBase

2014-07-07 Thread Igal @ getRailo.org

hi Terence,

thanks again for your reply.

I have autoDeploy set to false, but did not explicitly set 
deployOnStartup (I think that the default is true).  I am actually not 
using WARs so I'm not sure how, or if, any of this is applicable to my case.



Igal

On 7/7/2014 9:54 AM, Terence M. Bandoian wrote:

On 7/5/2014 1:38 PM, Igal @ getRailo.org wrote:

What version of Tomcat are you using?

I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8.

it is recommended that Context elements not be placed directly in 
server.xml
I know, but it is much easier for me to edit a single file, 
server.xml then deploy all the other files.  I'm looking to keep the 
deployment process as simple as possible.


you shouldn't need the empty directory. I've used an absolute path 
for the Host appBase attribute with relative paths for Context 
docBase attributes in Tomcat 6 and 7 without any problems.
when I try that then webapps is used by default.  if a request is 
made for a file that exists in webapps, e.g. index.jsp and does not 
exist in my application's folder, then it is served from webapps and 
I don't want that.


are you sure you want / for the Context path attribute in the 
first example above?
it was my understanding that  and / are the same here.  / reads 
more clearly to me as the root directory so I prefer to use that.


*after reading your email and testing it, however, I noticed that if 
I omit the Host/appBase and use an empty-string for the 
Context/docBase/path it works as intended, so maybe that's what I was 
doing wrong?  is that the best practice?*


Host name=Site1 unpackWARs=false autoDeploy=false
  Context path= docBase=D:/www/site1 /
  Context path=/virtualdir docBase=D:/www/shared/virtualdir /
/Host

?

thank you both for your responses,


Igal


On 7/5/2014 9:48 AM, Terence M. Bandoian wrote:

On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote:

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a 
base directory for websites.  What I've been doing so far is create 
an empty folder alongside webapps, named empty, and use it as 
appBase, e.g.


Host name=Site1 appBase=empty unpackWARs=false 
autoDeploy=false

  !-- this works but what's the deal with appBase? !--
  Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to 
work, but it doesn't:


Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false

  !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that 
is the way it should be, then what is the purpose of Host/appBase?


TIA



Hi, Igal-

What version of Tomcat are you using?  Also, it is recommended that 
Context elements not be placed directly in server.xml.  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context 



That said, you shouldn't need the empty directory.  I've used an 
absolute path for the Host appBase attribute with relative paths 
for Context docBase attributes in Tomcat 6 and 7 without any 
problems.  I haven't tried it with absolute paths for both appBase 
and docBase.


Lastly, are you sure you want / for the Context path attribute 
in the first example above?  The Context path for the default web 
application of a Host should be an empty string ().  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes 



-Terence Bandoian


Hi, Igal-

Glad you were able to get it working.  Please note the warning in the 
Tomcat docs about using the Context path attribute that reads:


Even when statically defining a Context in server.xml, this attribute 
must not be set unless either the docBase is not located under the 
Host's appBase or both deployOnStartup and autoDeploy are false. If 
this rule is not followed, double deployment is likely to result.


This is included in:

http://tomcat.apache.org/tomcat-8.0-doc/config/context.html#Common_Attributes 



For information about about how context paths relate to WAR file names 
and application directory names, see:


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

In particular, please note that If the context path is the empty 
string them the base name will be ROOT (always in upper case)


The recommended practice is to create separate context XML files and 
package them in the application WAR files.  However, for simple 
installations, I've had success with something like:


  Host name=Host
  appBase=c:/webapps
  autoDeploy=false
  deployOnStartup=true
  unpackWARs=true

Context path= docBase=ROOT /

  /Host

The [Tomcat]/webapps directory may then be deleted (if you don't need 
the packaged apps or doc) and ROOT.war placed directly in c:/webapps.


-Terence Bandoian


-
To unsubscribe, 

Re: Host appBase vs Context docBase

2014-07-05 Thread Neeraj Sinha
Normally,we configure docBase when we want the application to be resided on
a separate directory and not inside tomcat. So, when you use docBase I
don't think you need to configure host/appbase as well.
Appbase folders go under tomcat directory parallel to default appbase
webapps. Each appbase is mapped to a particular host so we configure more
than one appbases when we want to have applications running under different
hosts deployed in the same tomcat.

On Jul 5, 2014 7:35 AM, Igal @ getRailo.org i...@getrailo.org wrote:

 I'm a little confused about the Host appBase attribute.

 Let's say that my website resides in D:\www\site1

 I don't like using {Tomcat}/webapps so I don't want to have it as a base
directory for websites.  What I've been doing so far is create an empty
folder alongside webapps, named empty, and use it as appBase, e.g.

 Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false
   !-- this works but what's the deal with appBase? !--
   Context path=/ docBase=D:/www/site1 /
 /Host

 But it feels like I'm doing something wrong.  I expect this to work, but
it doesn't:

 Host name=Site1 appBase=D:/www/site1 unpackWARs=false
autoDeploy=false
   !-- this doesn't work !--
 /Host

 Can anyone explain why the snippet above doesn't work, and if that is the
way it should be, then what is the purpose of Host/appBase?

 TIA

 --
 Igal Sapir
 Railo Core Developer
 http://getRailo.org/


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



Re: Host appBase vs Context docBase

2014-07-05 Thread Terence M. Bandoian

On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote:

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a 
base directory for websites.  What I've been doing so far is create an 
empty folder alongside webapps, named empty, and use it as 
appBase, e.g.


Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false
  !-- this works but what's the deal with appBase? !--
  Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, 
but it doesn't:


Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false

  !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that is 
the way it should be, then what is the purpose of Host/appBase?


TIA



Hi, Igal-

What version of Tomcat are you using?  Also, it is recommended that 
Context elements not be placed directly in server.xml.  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context

That said, you shouldn't need the empty directory.  I've used an 
absolute path for the Host appBase attribute with relative paths for 
Context docBase attributes in Tomcat 6 and 7 without any problems.  I 
haven't tried it with absolute paths for both appBase and docBase.


Lastly, are you sure you want / for the Context path attribute in 
the first example above?  The Context path for the default web 
application of a Host should be an empty string ().  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes

-Terence Bandoian

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



Re: Host appBase vs Context docBase

2014-07-05 Thread Igal @ getRailo.org

Normally,we configure docBase when we want the application to be resided on a 
separate directory and not inside tomcat

that's exactly what I'm trying to do


when you use docBase I don't think you need to configure host/appbase as well
if I don't use host/appBase then webapps is set as default, and then 
if a document that exists in webapps is requested, e.g. /index.jsp and 
it does not exist in my application directory, then it is served from 
webapps, which is something that I really don't want to happen.


sure, I can clear the contents of the webapps folder instead of creating 
the empty folder, but not sure I want to do that either.



On 7/5/2014 3:49 AM, Neeraj Sinha wrote:

Normally,we configure docBase when we want the application to be resided on
a separate directory and not inside tomcat. So, when you use docBase I
don't think you need to configure host/appbase as well.
Appbase folders go under tomcat directory parallel to default appbase
webapps. Each appbase is mapped to a particular host so we configure more
than one appbases when we want to have applications running under different
hosts deployed in the same tomcat.

On Jul 5, 2014 7:35 AM, Igal @ getRailo.org i...@getrailo.org wrote:

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a base

directory for websites.  What I've been doing so far is create an empty
folder alongside webapps, named empty, and use it as appBase, e.g.

Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false
   !-- this works but what's the deal with appBase? !--
   Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, but

it doesn't:

Host name=Site1 appBase=D:/www/site1 unpackWARs=false

autoDeploy=false

   !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that is the

way it should be, then what is the purpose of Host/appBase?

TIA

--
Igal Sapir
Railo Core Developer
http://getRailo.org/


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



--
Igal Sapir
Railo Core Developer
http://getRailo.org/


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



Re: Host appBase vs Context docBase

2014-07-05 Thread Igal @ getRailo.org

What version of Tomcat are you using?

I've been using Tomcat 6 and 7 for a while, and now running Tomcat 8.

it is recommended that Context elements not be placed directly in 
server.xml
I know, but it is much easier for me to edit a single file, server.xml 
then deploy all the other files.  I'm looking to keep the deployment 
process as simple as possible.


you shouldn't need the empty directory. I've used an absolute path for 
the Host appBase attribute with relative paths for Context docBase 
attributes in Tomcat 6 and 7 without any problems.
when I try that then webapps is used by default.  if a request is made 
for a file that exists in webapps, e.g. index.jsp and does not exist in 
my application's folder, then it is served from webapps and I don't want 
that.


are you sure you want / for the Context path attribute in the 
first example above?
it was my understanding that  and / are the same here.  / reads 
more clearly to me as the root directory so I prefer to use that.


*after reading your email and testing it, however, I noticed that if I 
omit the Host/appBase and use an empty-string for the 
Context/docBase/path it works as intended, so maybe that's what I was 
doing wrong?  is that the best practice?*


Host name=Site1 unpackWARs=false autoDeploy=false
  Context path= docBase=D:/www/site1 /
  Context path=/virtualdir docBase=D:/www/shared/virtualdir /
/Host

?

thank you both for your responses,


Igal


On 7/5/2014 9:48 AM, Terence M. Bandoian wrote:

On 7/4/2014 9:04 PM, Igal @ getRailo.org wrote:

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a 
base directory for websites.  What I've been doing so far is create 
an empty folder alongside webapps, named empty, and use it as 
appBase, e.g.


Host name=Site1 appBase=empty unpackWARs=false 
autoDeploy=false

  !-- this works but what's the deal with appBase? !--
  Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, 
but it doesn't:


Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false

  !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that is 
the way it should be, then what is the purpose of Host/appBase?


TIA



Hi, Igal-

What version of Tomcat are you using?  Also, it is recommended that 
Context elements not be placed directly in server.xml.  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Defining_a_context 



That said, you shouldn't need the empty directory.  I've used an 
absolute path for the Host appBase attribute with relative paths for 
Context docBase attributes in Tomcat 6 and 7 without any problems.  
I haven't tried it with absolute paths for both appBase and docBase.


Lastly, are you sure you want / for the Context path attribute in 
the first example above?  The Context path for the default web 
application of a Host should be an empty string ().  See:


http://tomcat.apache.org/tomcat-7.0-doc/config/context.html#Common_Attributes 



-Terence Bandoian

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



--
Igal Sapir
Railo Core Developer
http://getRailo.org/



Host appBase vs Context docBase

2014-07-04 Thread Igal @ getRailo.org

I'm a little confused about the Host appBase attribute.

Let's say that my website resides in D:\www\site1

I don't like using {Tomcat}/webapps so I don't want to have it as a base 
directory for websites.  What I've been doing so far is create an empty 
folder alongside webapps, named empty, and use it as appBase, e.g.


Host name=Site1 appBase=empty unpackWARs=false autoDeploy=false
  !-- this works but what's the deal with appBase? !--
  Context path=/ docBase=D:/www/site1 /
/Host

But it feels like I'm doing something wrong.  I expect this to work, but 
it doesn't:


Host name=Site1 appBase=D:/www/site1 unpackWARs=false 
autoDeploy=false

  !-- this doesn't work !--
/Host

Can anyone explain why the snippet above doesn't work, and if that is 
the way it should be, then what is the purpose of Host/appBase?


TIA

--
Igal Sapir
Railo Core Developer
http://getRailo.org/


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