You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Michael B Allen <io...@gmail.com> on 2021/11/15 20:15:58 UTC

How to *properly* create and use a CATALINA_BASE installation

Hi,

What $CATALINA_HOME/conf/ files should be copied into $CATALINA_BASE?

RUNNING.txt just says:

* conf - Server configuration files (including server.xml)

So it's multiple fileS but not necessarily all if server.xml is
explicitly included?

Ideally I would think it should be only files that need to be modified
since that seems to be the point of using $CATALINA_BASE. Is this
correct?

I'm trying to use $CATALINA_BASE just because it seems like the proper
way to setup Tomcat in general.

Without $CATALINA_BASE everything works as near as I can tell.

But if I change $CATALINA_BASE to be different from $CATALINA_HOME in
my startup bat like:

$CATALINA_HOME/bin/xstart.bat:
SETLOCAL

set JRE_HOME=%ProgramFiles%\Java\jre1.8.0_311
set CATALINA_HOME=C:\path\to\tomcat
set CATALINA_BASE=C:\path\to\tomcat-base

"%CATALINA_HOME%\bin\catalina.bat" run %1 %2 %3 %4 %5 %6 %7 %8 %9

And then in tomcat-base I have:

bin\tomcat-juli.jar
conf\keystore.jks
conf\server.xml

The server.xml is stock except for the following:

    <Connector
        port="8443"
        protocol="org.apache.coyote.http11.Http11NioProtocol"
        scheme="https"
        secure="true"
        SSLEnabled="true">
        <SSLHostConfig>
            <Certificate
                certificateKeystoreFile="conf/keystore.jks"
                certificateKeystorePassword="as1busiw19"/>
        </SSLHostConfig>
    </Connector>

conf\tomcat-users.xml
conf\Catalina\localhost\manager.xml
logs\localhost_access_log.2021-11-15.txt
temp\
webapps\myapp\<mywebappfiles>

Note: There is no myapp\WEB-INF\context.xml

webapps\manager\<managerfiles>

Tomcat starts up ok and Tomcat Manager works. I can see myapp in the
manager which claims it's deployed and running.

But trying to access /myapp results in:

    404 Not Found: The origin server did not find a current
representation for the target resource or is not willing to
disclose that one exists.

I can un-deploy /myapp and re-deploy it through the manager and again,
nothing but 404.

Doesn't work under HTTPS either (and HTTPS works without using $CATALINA_BASE).

What could be the problem here?

I used the following to create a symbolic link to the tomcat directory:

cmd>mklink /d tomcat apache-tomcat-9.0.54

Is this ok?

I'm using Tomcat 9.0.54 32 bit on Windows Server 2016 64 bit. The
native runtime DLL fails to load because it's built for 32bit. But
this seems to fallback to the Java runtime just fine. Is this somehow
a problem?

Do I need a deployment context xml?

I'm a little stumped by this. I don't normally use Tomcat but I just
wanted to create an "Application Note" about how to properly use my
product with Tomcat. So I'm really interested in how this all is
supposed to work and not so much just seeing it work.

Thanks,

Mike
-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by "Mark H. Wood" <mw...@iupui.edu>.
The Gentoo Linux packaging of Tomcat does a nice job of laying out
separate CATALINA_HOME and one or more CATALINA_BASE trees, if you'd
like something to study.

-- 
Mark H. Wood
Lead Technology Analyst

University Library
Indiana University - Purdue University Indianapolis
755 W. Michigan Street
Indianapolis, IN 46202
317-274-0749
www.ulib.iupui.edu

RE: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
Thanks for the info Chris!

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

> -----Original Message-----
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Wednesday, November 17, 2021 9:41 AM
> To: users@tomcat.apache.org
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> Jon,
> 
> On 11/16/21 12:55, jonmcalexander@wellsfargo.com.INVALID wrote:
> > I meant the other configuration files. I guess I haven't dug deep enough,
> but DOES Tomcat handle the catalina.properties, catalina.policy,
> logging.properties, etc. files hierarchically similar to how Microsoft handles
> web.config files? CATALINA_HOME being the parent and Instances
> automatically inheriting from the Parent unless overridden at the instance
> level in its conf folder?
> >
> > Basically can I publish a parent catalina.policy file and NOT include one in
> the instance?
> 
> My presentation says you need your own if you want to use the security
> manager. Looking at catalina.sh, it always uses CATALINA_BASE for that
> purpose, but it could be detected at runtime. Patches are welcome.
> 
> When using the Windows Service runner, the path to the catalina.policy file is
> captured in the Windows Registry, so you can't detect it on the fly. That path
> must be passed-into the launching JVM, so by the time Tomcat gets chance
> to observe the situation, it's too late to make any changes.
> 
> So if you were to change this in catalina.sh|bat, you'd want to make a similar
> change to service.bat to auto-detect the (current) situation and store the
> appropriate path in the registry, understanding that any change to the file-
> layout would require a refresh of that stored-info.
> 
> -chris
> 
> >> -----Original Message-----
> >> From: Christopher Schultz <ch...@christopherschultz.net>
> >> Sent: Tuesday, November 16, 2021 11:39 AM
> >> To: users@tomcat.apache.org
> >> Subject: Re: How to *properly* create and use a CATALINA_BASE
> >> installation
> >>
> >> Jon,
> >>
> >> On 11/16/21 08:55, jonmcalexander@wellsfargo.com.INVALID wrote:
> >>> I too would like to know more of what Chris is sa­ying in regards to
> >>> the conf
> >> folder.
> >>
> >> You mean conf/[engine]/[host]/[webapp].xml? This is just "standard"
> >> deployment descriptor stuff:
> >> https://urldefense.com/v3/__http://tomcat.apache.org/tomcat-8.5-
> >> doc/config/context.html*Naming__;Iw!!F9svGWnIaVPGSwU!-
> >> J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
> >> _HG16mI1aNMIUDsoU$
> >>
> >> -chris
> >>
> >>>
> >>>
> >>> Thanks,
> >>>
> >>> Sent with BlackBerry Work
> >>>
> >>
> (https://urldefense.com/v3/__http://www.blackberry.com__;!!F9svGWnIa
> >> VP
> >>> GSwU!-
> J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
> >> _HG16mI1aNO
> >>> XCqE2Q$ ) ________________________________
> >>> From: Michael B Allen <io...@gmail.com>
> >>> Sent: Nov 15, 2021 4:24 PM
> >>> To: Tomcat Users List <us...@tomcat.apache.org>
> >>> Subject: Re: How to *properly* create and use a CATALINA_BASE
> >>> installation
> >>>
> >>> On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
> >>> <ch...@christopherschultz.net> wrote:
> >>>>> conf
> >>>>> All of the conf files.
> >>>>
> >>>> Specifically, you'll want server.xml and web.xml. You can also
> >>>> choose to customize context.xml, and put any
> >>>> [engine]/[host]/[webapp].xml deployment descriptors there.
> >>>
> >>> Hi chros,
> >>>
> >>> Ok, so then the minimum required is server.xml and web.xml?
> >>>
> >>> And then there are optional files like context.xml? Are all of the
> >>> other files also optional and completely overwrite settings like
> >>> tomcat-users.xml or only some?
> >>>
> >>> I have confirmed that adding only web.xml alone resolves the issue
> >>> completely. I no longer get 404's and the application works. But I
> >>> would like to further understand this as much as possible to
> >>> document it for my customers.
> >>>
> >>> Thanks,
> >>> Mike
> >>>
> >>> --
> >>> Michael B Allen
> >>> Java Active Directory Integration
> >>>
> >>
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
> >> SwU
> >>> !7AZZQCO9WJpNEOtenm9YTmcUeIkzx380FbL8mx5PyVGCQ-
> >> EBXRwRiA3AwP2ZQheJHlz-1
> >>> L4$
> >>>
> >>> --------------------------------------------------------------------
> >>> - 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
> >
> 
> ---------------------------------------------------------------------
> 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: How to *properly* create and use a CATALINA_BASE installation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/16/21 12:55, jonmcalexander@wellsfargo.com.INVALID wrote:
> I meant the other configuration files. I guess I haven't dug deep enough, but DOES Tomcat handle the catalina.properties, catalina.policy, logging.properties, etc. files hierarchically similar to how Microsoft handles web.config files? CATALINA_HOME being the parent and Instances automatically inheriting from the Parent unless overridden at the instance level in its conf folder?
> 
> Basically can I publish a parent catalina.policy file and NOT include one in the instance?

My presentation says you need your own if you want to use the security 
manager. Looking at catalina.sh, it always uses CATALINA_BASE for that 
purpose, but it could be detected at runtime. Patches are welcome.

When using the Windows Service runner, the path to the catalina.policy 
file is captured in the Windows Registry, so you can't detect it on the 
fly. That path must be passed-into the launching JVM, so by the time 
Tomcat gets chance to observe the situation, it's too late to make any 
changes.

So if you were to change this in catalina.sh|bat, you'd want to make a 
similar change to service.bat to auto-detect the (current) situation and 
store the appropriate path in the registry, understanding that any 
change to the file-layout would require a refresh of that stored-info.

-chris

>> -----Original Message-----
>> From: Christopher Schultz <ch...@christopherschultz.net>
>> Sent: Tuesday, November 16, 2021 11:39 AM
>> To: users@tomcat.apache.org
>> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
>>
>> Jon,
>>
>> On 11/16/21 08:55, jonmcalexander@wellsfargo.com.INVALID wrote:
>>> I too would like to know more of what Chris is sa­ying in regards to the conf
>> folder.
>>
>> You mean conf/[engine]/[host]/[webapp].xml? This is just "standard"
>> deployment descriptor stuff:
>> https://urldefense.com/v3/__http://tomcat.apache.org/tomcat-8.5-
>> doc/config/context.html*Naming__;Iw!!F9svGWnIaVPGSwU!-
>> J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
>> _HG16mI1aNMIUDsoU$
>>
>> -chris
>>
>>>
>>>
>>> Thanks,
>>>
>>> Sent with BlackBerry Work
>>>
>> (https://urldefense.com/v3/__http://www.blackberry.com__;!!F9svGWnIa
>> VP
>>> GSwU!-J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
>> _HG16mI1aNO
>>> XCqE2Q$ ) ________________________________
>>> From: Michael B Allen <io...@gmail.com>
>>> Sent: Nov 15, 2021 4:24 PM
>>> To: Tomcat Users List <us...@tomcat.apache.org>
>>> Subject: Re: How to *properly* create and use a CATALINA_BASE
>>> installation
>>>
>>> On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
>>> <ch...@christopherschultz.net> wrote:
>>>>> conf
>>>>> All of the conf files.
>>>>
>>>> Specifically, you'll want server.xml and web.xml. You can also choose
>>>> to customize context.xml, and put any [engine]/[host]/[webapp].xml
>>>> deployment descriptors there.
>>>
>>> Hi chros,
>>>
>>> Ok, so then the minimum required is server.xml and web.xml?
>>>
>>> And then there are optional files like context.xml? Are all of the
>>> other files also optional and completely overwrite settings like
>>> tomcat-users.xml or only some?
>>>
>>> I have confirmed that adding only web.xml alone resolves the issue
>>> completely. I no longer get 404's and the application works. But I
>>> would like to further understand this as much as possible to document
>>> it for my customers.
>>>
>>> Thanks,
>>> Mike
>>>
>>> --
>>> Michael B Allen
>>> Java Active Directory Integration
>>>
>> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
>> SwU
>>> !7AZZQCO9WJpNEOtenm9YTmcUeIkzx380FbL8mx5PyVGCQ-
>> EBXRwRiA3AwP2ZQheJHlz-1
>>> L4$
>>>
>>> ---------------------------------------------------------------------
>>> 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
> 

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


RE: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
I meant the other configuration files. I guess I haven't dug deep enough, but DOES Tomcat handle the catalina.properties, catalina.policy, logging.properties, etc. files hierarchically similar to how Microsoft handles web.config files? CATALINA_HOME being the parent and Instances automatically inheriting from the Parent unless overridden at the instance level in its conf folder?

Basically can I publish a parent catalina.policy file and NOT include one in the instance?

Thanks,

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.


> -----Original Message-----
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Tuesday, November 16, 2021 11:39 AM
> To: users@tomcat.apache.org
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> Jon,
> 
> On 11/16/21 08:55, jonmcalexander@wellsfargo.com.INVALID wrote:
> > I too would like to know more of what Chris is sa­ying in regards to the conf
> folder.
> 
> You mean conf/[engine]/[host]/[webapp].xml? This is just "standard"
> deployment descriptor stuff:
> https://urldefense.com/v3/__http://tomcat.apache.org/tomcat-8.5-
> doc/config/context.html*Naming__;Iw!!F9svGWnIaVPGSwU!-
> J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
> _HG16mI1aNMIUDsoU$
> 
> -chris
> 
> >
> >
> > Thanks,
> >
> > Sent with BlackBerry Work
> >
> (https://urldefense.com/v3/__http://www.blackberry.com__;!!F9svGWnIa
> VP
> > GSwU!-J4ClOAv1FBlpqrYFufoMLwNKP7MYp1SNF2n56QIN2gbaVLDGedI1-
> _HG16mI1aNO
> > XCqE2Q$ ) ________________________________
> > From: Michael B Allen <io...@gmail.com>
> > Sent: Nov 15, 2021 4:24 PM
> > To: Tomcat Users List <us...@tomcat.apache.org>
> > Subject: Re: How to *properly* create and use a CATALINA_BASE
> > installation
> >
> > On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
> > <ch...@christopherschultz.net> wrote:
> >>> conf
> >>> All of the conf files.
> >>
> >> Specifically, you'll want server.xml and web.xml. You can also choose
> >> to customize context.xml, and put any [engine]/[host]/[webapp].xml
> >> deployment descriptors there.
> >
> > Hi chros,
> >
> > Ok, so then the minimum required is server.xml and web.xml?
> >
> > And then there are optional files like context.xml? Are all of the
> > other files also optional and completely overwrite settings like
> > tomcat-users.xml or only some?
> >
> > I have confirmed that adding only web.xml alone resolves the issue
> > completely. I no longer get 404's and the application works. But I
> > would like to further understand this as much as possible to document
> > it for my customers.
> >
> > Thanks,
> > Mike
> >
> > --
> > Michael B Allen
> > Java Active Directory Integration
> >
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
> SwU
> > !7AZZQCO9WJpNEOtenm9YTmcUeIkzx380FbL8mx5PyVGCQ-
> EBXRwRiA3AwP2ZQheJHlz-1
> > L4$
> >
> > ---------------------------------------------------------------------
> > 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: How to *properly* create and use a CATALINA_BASE installation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/16/21 08:55, jonmcalexander@wellsfargo.com.INVALID wrote:
> I too would like to know more of what Chris is sa­ying in regards to the conf folder.

You mean conf/[engine]/[host]/[webapp].xml? This is just "standard" 
deployment descriptor stuff:
http://tomcat.apache.org/tomcat-8.5-doc/config/context.html#Naming

-chris

> 
> 
> Thanks,
> 
> Sent with BlackBerry Work (www.blackberry.com)
> ________________________________
> From: Michael B Allen <io...@gmail.com>
> Sent: Nov 15, 2021 4:24 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
> <ch...@christopherschultz.net> wrote:
>>> conf
>>> All of the conf files.
>>
>> Specifically, you'll want server.xml and web.xml. You can also choose to
>> customize context.xml, and put any [engine]/[host]/[webapp].xml
>> deployment descriptors there.
> 
> Hi chros,
> 
> Ok, so then the minimum required is server.xml and web.xml?
> 
> And then there are optional files like context.xml? Are all of the
> other files also optional and completely overwrite settings like
> tomcat-users.xml or only some?
> 
> I have confirmed that adding only web.xml alone resolves the issue
> completely. I no longer get 404's and the application works. But I
> would like to further understand this as much as possible to document
> it for my customers.
> 
> Thanks,
> Mike
> 
> --
> Michael B Allen
> Java Active Directory Integration
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!7AZZQCO9WJpNEOtenm9YTmcUeIkzx380FbL8mx5PyVGCQ-EBXRwRiA3AwP2ZQheJHlz-1L4$
> 
> ---------------------------------------------------------------------
> 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: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
Hey Michael,

I too would like to know more of what Chris is sa­ying in regards to the conf folder.


Thanks,

Sent with BlackBerry Work (www.blackberry.com)
________________________________
From: Michael B Allen <io...@gmail.com>
Sent: Nov 15, 2021 4:24 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: How to *properly* create and use a CATALINA_BASE installation

On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
<ch...@christopherschultz.net> wrote:
> > conf
> > All of the conf files.
>
> Specifically, you'll want server.xml and web.xml. You can also choose to
> customize context.xml, and put any [engine]/[host]/[webapp].xml
> deployment descriptors there.

Hi chros,

Ok, so then the minimum required is server.xml and web.xml?

And then there are optional files like context.xml? Are all of the
other files also optional and completely overwrite settings like
tomcat-users.xml or only some?

I have confirmed that adding only web.xml alone resolves the issue
completely. I no longer get 404's and the application works. But I
would like to further understand this as much as possible to document
it for my customers.

Thanks,
Mike

--
Michael B Allen
Java Active Directory Integration
https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!7AZZQCO9WJpNEOtenm9YTmcUeIkzx380FbL8mx5PyVGCQ-EBXRwRiA3AwP2ZQheJHlz-1L4$

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
Jon,

On 11/17/2021 6:54 PM, jonmcalexander@wellsfargo.com.INVALID wrote:
> Sorry about my bad reply order.  Mark, you do a lot of what I do, but most of our stuff isn't using initd. I like your use of links, best way to handle upgrades, imo.­
> 
> 
> Thanks,
> 
> 
> Sent with BlackBerry Work (www.blackberry.com)
> ________________________________
> From: Mark Eggers <it...@yahoo.com.INVALID>
> Sent: Nov 17, 2021 8:10 PM
> To: users@tomcat.apache.org
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> 
> On 11/17/2021 5:28 PM, jonmcalexander@wellsfargo.com.INVALID<ma...@wellsfargo.com.INVALID> wrote:
>> We export it. You have to make sure the setenv.sh<http://setenv.sh> is calling setenv.sh<http://setenv.sh>. it works fine for me.­
>>
>>
>> Thanks,
>>
>>
>> Sent with BlackBerry Work (www.blackberry.com<http://www.blackberry.com>)
>> ________________________________
>> From: Michael B Allen <io...@gmail.com>>
>> Sent: Nov 17, 2021 6:54 PM
>> To: Tomcat Users List <us...@tomcat.apache.org>>
>> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
>>
>> On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid>> wrote:
>>> I, in my opinion, find it far easier to set my BASE in the setenv.sh<http://setenv.sh> for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.
>>
>> Jon,
>>
>> If you mean you're setting $CATALINA_BASE in setenv.sh<http://setenv.sh>, I don't think
>> that will work because when you run $CATALINA_BASE/bin/startup.sh<http://startup.sh>,
>> $CATALINA_BASE won't be set yet and so it's going to set
>> $CATALINA_BASE to $CATALINA_HOME and then source the
>> $CATALINA_HOME/bin/setenv.sh<http://setenv.sh> and not the $CATALINA_BASE specific
>> setenv.sh<http://setenv.sh>. I think that's what Chris was referring to in his first
>> reply to you.
>>
>> Although if I'm using a $CATALINA_BASE/bin/run.sh<http://run.sh> alternative to
>> startup.sh<http://startup.sh> like in my previous post, I would probably just put ALL the
>> various environment variables (listed at the top of bin/catalina.sh<http://catalina.sh>)
>> in there too. Using setenv.sh<http://setenv.sh> at that point would just be needlessly
>> spreading config around.
>>
>> The documentation currently seems to be targeting installations shared
>> by multiple different users where $CATALINA_HOME and $CATALINA_BASE
>> get set in the users environment such that different users can have
>> different bases but share a common installation like in /usr/local or
>> some such. Then you *would* want to put base specific stuff in
>> $CATALINA_BASE/bin/setenv.sh<http://setenv.sh>. But IMO that's kind of a late 90's way
>> of doing things. Nowadays, not only do people have their own machines,
>> but they have multiple instances in VMs and private servers and docker
>> and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh<http://run.sh>
>> method is probably a little better for most cases (although I still
>> need to study the Windows service use-case which is probably
>> important).
>>
>> Mike
>>
>> --
>> Michael B Allen
>> Java Active Directory Integration
>> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$ ;
> 
> On Linux with systemd, I put the following in the systemd file:
> 
> Environment=CATALINA_HOME=/home/tcadmin/Services/[sname]/CATALINA_HOME/
> Environment=CATALINA_BASE=/home/tcadmin/Services/[sname]CATALINA_BASE/
> Environment=CATALINA_PID=/var/run/tomcat/[sname].pid
> 
> where [sname] is the name of the service.
> 
> tcadmin is the unprivileged user that runs all the Tomcats on the system.
> 
> Everything else is set in
> /home/tcadmin/Services/[sname]/CATALINA_BASE/bin/setenv.sh<http://setenv.sh>
> 
> For the old style init.d systems, I put everything in:
> 
> /etc/sysconfig/[tomcatx]/[sname]
> 
> where [tomcatx] is the base version of Tomcat, and [sname] is the
> service name.
> 
> Then there is an init file for each service that reads the
> appropriate /etc/sysconfig/[tomcatx]/[sname] file to set the up the
> environment.
> 
> CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
> installation, and one configured for that particular service.
> 
> Then to upgrade to a new Tomcat, you do the following:
> 
> 1. Unpack the new reference version of Tomcat somewhere which becomes
> CATALINA_HOME.
> 
> 2. Create the new service-specific installation of Tomcat which becomes
> CATALINA_BASE.
> 
> All of the above can be done without disturbing the existing service.
> 
> To upgrade, do the following:
> 
> 1. Shut down the service
> 2. Move the links
> 3. Start up the service
> 
> If things blow up in your face, then the roll back is really easy:
> 
> 1. Shut down the service
> 2. Restore the links
> 3. Start up the service
> 
> Since the CATALINA_BASE is linked to a version-specific directory,
> you'll have log files to figure out why things didn't go according to
> plan if you have to roll back.
> 
> Automate configuring your CATALINA_BASE setup with a couple of Ant
> build.xml<http://build.xml> files, a couple of property files, with an XSLT file or two,
> and configuring a new version of Tomcat takes a few seconds.
> 
> Version the property files to keep track of Tomcat updates, and you can
> keep track of what was changed, by whom, and when. All of that makes a
> sysadmin a happy camper.
> 
> Add more or less automation to taste.
> 
> This is of course only germane if you're running a traditional IS
> architecture.
> 
> . . . just my two cents
> /mde/
> 
> On 11/17/2021 5:28 PM, jonmcalexander@wellsfargo.com.INVALID wrote:
>> We export it. You have to make sure the setenv.sh is calling setenv.sh. it works fine for me.­
>>
>>
>> Thanks,
>>
>>
>> Sent with BlackBerry Work (www.blackberry.com<http://www.blackberry.com>)
>> ________________________________
>> From: Michael B Allen <io...@gmail.com>
>> Sent: Nov 17, 2021 6:54 PM
>> To: Tomcat Users List <us...@tomcat.apache.org>
>> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
>>
>> On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid> wrote:
>>> I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.
>>
>> Jon,
>>
>> If you mean you're setting $CATALINA_BASE in setenv.sh, I don't think
>> that will work because when you run $CATALINA_BASE/bin/startup.sh,
>> $CATALINA_BASE won't be set yet and so it's going to set
>> $CATALINA_BASE to $CATALINA_HOME and then source the
>> $CATALINA_HOME/bin/setenv.sh and not the $CATALINA_BASE specific
>> setenv.sh. I think that's what Chris was referring to in his first
>> reply to you.
>>
>> Although if I'm using a $CATALINA_BASE/bin/run.sh alternative to
>> startup.sh like in my previous post, I would probably just put ALL the
>> various environment variables (listed at the top of bin/catalina.sh)
>> in there too. Using setenv.sh at that point would just be needlessly
>> spreading config around.
>>
>> The documentation currently seems to be targeting installations shared
>> by multiple different users where $CATALINA_HOME and $CATALINA_BASE
>> get set in the users environment such that different users can have
>> different bases but share a common installation like in /usr/local or
>> some such. Then you *would* want to put base specific stuff in
>> $CATALINA_BASE/bin/setenv.sh. But IMO that's kind of a late 90's way
>> of doing things. Nowadays, not only do people have their own machines,
>> but they have multiple instances in VMs and private servers and docker
>> and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh
>> method is probably a little better for most cases (although I still
>> need to study the Windows service use-case which is probably
>> important).
>>
>> Mike
>>
>> --
>> Michael B Allen
>> Java Active Directory Integration
>> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$
> 
> On Linux with systemd, I put the following in the systemd file:
> 
> Environment=CATALINA_HOME=/home/tcadmin/Services/[sname]/CATALINA_HOME/
> Environment=CATALINA_BASE=/home/tcadmin/Services/[sname]CATALINA_BASE/
> Environment=CATALINA_PID=/var/run/tomcat/[sname].pid
> 
> where [sname] is the name of the service.
> 
> tcadmin is the unprivileged user that runs all the Tomcats on the system.
> 
> Everything else is set in
> /home/tcadmin/Services/[sname]/CATALINA_BASE/bin/setenv.sh
> 
> For the old style init.d systems, I put everything in:
> 
> /etc/sysconfig/[tomcatx]/[sname]
> 
> where [tomcatx] is the base version of Tomcat, and [sname] is the
> service name.
> 
> Then there is an init file for each service that reads the
> appropriate /etc/sysconfig/[tomcatx]/[sname] file to set the up the
> environment.
> 
> CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
> installation, and one configured for that particular service.
> 
> Then to upgrade to a new Tomcat, you do the following:
> 
> 1. Unpack the new reference version of Tomcat somewhere which becomes
> CATALINA_HOME.
> 
> 2. Create the new service-specific installation of Tomcat which becomes
> CATALINA_BASE.
> 
> All of the above can be done without disturbing the existing service.
> 
> To upgrade, do the following:
> 
> 1. Shut down the service
> 2. Move the links
> 3. Start up the service
> 
> If things blow up in your face, then the roll back is really easy:
> 
> 1. Shut down the service
> 2. Restore the links
> 3. Start up the service
> 
> Since the CATALINA_BASE is linked to a version-specific directory,
> you'll have log files to figure out why things didn't go according to
> plan if you have to roll back.
> 
> Automate configuring your CATALINA_BASE setup with a couple of Ant
> build.xml files, a couple of property files, with an XSLT file or two,
> and configuring a new version of Tomcat takes a few seconds.
> 
> Version the property files to keep track of Tomcat updates, and you can
> keep track of what was changed, by whom, and when. All of that makes a
> sysadmin a happy camper.
> 
> Add more or less automation to taste.
> 
> This is of course only germane if you're running a traditional IS
> architecture.
> 
> . . . just my two cents
> /mde/
> 

On our systemd environments, we set the bare minimum in the 
tomcat@sname.service file. That turns out to be:

Environment=CATALINA_HOME=/home/tcadmin/Services/%i/CATALINA_HOME/
Environment=CATALINA_BASE=/home/tcadmin/Services/%i/CATALINA_BASE/
Environment=CATALINA_PID=/var/run/tomcat/%i.pid

The %i works on Debian-based systems, but not on RedHat-based systems.

Everything else gets stuffed into setenv.sh per service.

. . . just my two cents
/mde/

RE: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
Sorry about my bad reply order.  Mark, you do a lot of what I do, but most of our stuff isn't using initd. I like your use of links, best way to handle upgrades, imo.­


Thanks,


Sent with BlackBerry Work (www.blackberry.com)
________________________________
From: Mark Eggers <it...@yahoo.com.INVALID>
Sent: Nov 17, 2021 8:10 PM
To: users@tomcat.apache.org
Subject: Re: How to *properly* create and use a CATALINA_BASE installation


On 11/17/2021 5:28 PM, jonmcalexander@wellsfargo.com.INVALID<ma...@wellsfargo.com.INVALID> wrote:
> We export it. You have to make sure the setenv.sh<http://setenv.sh> is calling setenv.sh<http://setenv.sh>. it works fine for me.­
>
>
> Thanks,
>
>
> Sent with BlackBerry Work (www.blackberry.com<http://www.blackberry.com>)
> ________________________________
> From: Michael B Allen <io...@gmail.com>>
> Sent: Nov 17, 2021 6:54 PM
> To: Tomcat Users List <us...@tomcat.apache.org>>
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
>
> On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid>> wrote:
>> I, in my opinion, find it far easier to set my BASE in the setenv.sh<http://setenv.sh> for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.
>
> Jon,
>
> If you mean you're setting $CATALINA_BASE in setenv.sh<http://setenv.sh>, I don't think
> that will work because when you run $CATALINA_BASE/bin/startup.sh<http://startup.sh>,
> $CATALINA_BASE won't be set yet and so it's going to set
> $CATALINA_BASE to $CATALINA_HOME and then source the
> $CATALINA_HOME/bin/setenv.sh<http://setenv.sh> and not the $CATALINA_BASE specific
> setenv.sh<http://setenv.sh>. I think that's what Chris was referring to in his first
> reply to you.
>
> Although if I'm using a $CATALINA_BASE/bin/run.sh<http://run.sh> alternative to
> startup.sh<http://startup.sh> like in my previous post, I would probably just put ALL the
> various environment variables (listed at the top of bin/catalina.sh<http://catalina.sh>)
> in there too. Using setenv.sh<http://setenv.sh> at that point would just be needlessly
> spreading config around.
>
> The documentation currently seems to be targeting installations shared
> by multiple different users where $CATALINA_HOME and $CATALINA_BASE
> get set in the users environment such that different users can have
> different bases but share a common installation like in /usr/local or
> some such. Then you *would* want to put base specific stuff in
> $CATALINA_BASE/bin/setenv.sh<http://setenv.sh>. But IMO that's kind of a late 90's way
> of doing things. Nowadays, not only do people have their own machines,
> but they have multiple instances in VMs and private servers and docker
> and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh<http://run.sh>
> method is probably a little better for most cases (although I still
> need to study the Windows service use-case which is probably
> important).
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$ ;

On Linux with systemd, I put the following in the systemd file:

Environment=CATALINA_HOME=/home/tcadmin/Services/[sname]/CATALINA_HOME/
Environment=CATALINA_BASE=/home/tcadmin/Services/[sname]CATALINA_BASE/
Environment=CATALINA_PID=/var/run/tomcat/[sname].pid

where [sname] is the name of the service.

tcadmin is the unprivileged user that runs all the Tomcats on the system.

Everything else is set in
/home/tcadmin/Services/[sname]/CATALINA_BASE/bin/setenv.sh<http://setenv.sh>

For the old style init.d systems, I put everything in:

/etc/sysconfig/[tomcatx]/[sname]

where [tomcatx] is the base version of Tomcat, and [sname] is the
service name.

Then there is an init file for each service that reads the
appropriate /etc/sysconfig/[tomcatx]/[sname] file to set the up the
environment.

CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
installation, and one configured for that particular service.

Then to upgrade to a new Tomcat, you do the following:

1. Unpack the new reference version of Tomcat somewhere which becomes
CATALINA_HOME.

2. Create the new service-specific installation of Tomcat which becomes
CATALINA_BASE.

All of the above can be done without disturbing the existing service.

To upgrade, do the following:

1. Shut down the service
2. Move the links
3. Start up the service

If things blow up in your face, then the roll back is really easy:

1. Shut down the service
2. Restore the links
3. Start up the service

Since the CATALINA_BASE is linked to a version-specific directory,
you'll have log files to figure out why things didn't go according to
plan if you have to roll back.

Automate configuring your CATALINA_BASE setup with a couple of Ant
build.xml<http://build.xml> files, a couple of property files, with an XSLT file or two,
and configuring a new version of Tomcat takes a few seconds.

Version the property files to keep track of Tomcat updates, and you can
keep track of what was changed, by whom, and when. All of that makes a
sysadmin a happy camper.

Add more or less automation to taste.

This is of course only germane if you're running a traditional IS
architecture.

. . . just my two cents
/mde/

On 11/17/2021 5:28 PM, jonmcalexander@wellsfargo.com.INVALID wrote:
> We export it. You have to make sure the setenv.sh is calling setenv.sh. it works fine for me.­
>
>
> Thanks,
>
>
> Sent with BlackBerry Work (www.blackberry.com<http://www.blackberry.com>)
> ________________________________
> From: Michael B Allen <io...@gmail.com>
> Sent: Nov 17, 2021 6:54 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
>
> On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid> wrote:
>> I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.
>
> Jon,
>
> If you mean you're setting $CATALINA_BASE in setenv.sh, I don't think
> that will work because when you run $CATALINA_BASE/bin/startup.sh,
> $CATALINA_BASE won't be set yet and so it's going to set
> $CATALINA_BASE to $CATALINA_HOME and then source the
> $CATALINA_HOME/bin/setenv.sh and not the $CATALINA_BASE specific
> setenv.sh. I think that's what Chris was referring to in his first
> reply to you.
>
> Although if I'm using a $CATALINA_BASE/bin/run.sh alternative to
> startup.sh like in my previous post, I would probably just put ALL the
> various environment variables (listed at the top of bin/catalina.sh)
> in there too. Using setenv.sh at that point would just be needlessly
> spreading config around.
>
> The documentation currently seems to be targeting installations shared
> by multiple different users where $CATALINA_HOME and $CATALINA_BASE
> get set in the users environment such that different users can have
> different bases but share a common installation like in /usr/local or
> some such. Then you *would* want to put base specific stuff in
> $CATALINA_BASE/bin/setenv.sh. But IMO that's kind of a late 90's way
> of doing things. Nowadays, not only do people have their own machines,
> but they have multiple instances in VMs and private servers and docker
> and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh
> method is probably a little better for most cases (although I still
> need to study the Windows service use-case which is probably
> important).
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$

On Linux with systemd, I put the following in the systemd file:

Environment=CATALINA_HOME=/home/tcadmin/Services/[sname]/CATALINA_HOME/
Environment=CATALINA_BASE=/home/tcadmin/Services/[sname]CATALINA_BASE/
Environment=CATALINA_PID=/var/run/tomcat/[sname].pid

where [sname] is the name of the service.

tcadmin is the unprivileged user that runs all the Tomcats on the system.

Everything else is set in
/home/tcadmin/Services/[sname]/CATALINA_BASE/bin/setenv.sh

For the old style init.d systems, I put everything in:

/etc/sysconfig/[tomcatx]/[sname]

where [tomcatx] is the base version of Tomcat, and [sname] is the
service name.

Then there is an init file for each service that reads the
appropriate /etc/sysconfig/[tomcatx]/[sname] file to set the up the
environment.

CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
installation, and one configured for that particular service.

Then to upgrade to a new Tomcat, you do the following:

1. Unpack the new reference version of Tomcat somewhere which becomes
CATALINA_HOME.

2. Create the new service-specific installation of Tomcat which becomes
CATALINA_BASE.

All of the above can be done without disturbing the existing service.

To upgrade, do the following:

1. Shut down the service
2. Move the links
3. Start up the service

If things blow up in your face, then the roll back is really easy:

1. Shut down the service
2. Restore the links
3. Start up the service

Since the CATALINA_BASE is linked to a version-specific directory,
you'll have log files to figure out why things didn't go according to
plan if you have to roll back.

Automate configuring your CATALINA_BASE setup with a couple of Ant
build.xml files, a couple of property files, with an XSLT file or two,
and configuring a new version of Tomcat takes a few seconds.

Version the property files to keep track of Tomcat updates, and you can
keep track of what was changed, by whom, and when. All of that makes a
sysadmin a happy camper.

Add more or less automation to taste.

This is of course only germane if you're running a traditional IS
architecture.

. . . just my two cents
/mde/

Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Michael B Allen <io...@gmail.com>.
On Thu, Nov 18, 2021 at 12:06 PM Mark Eggers
<it...@yahoo.com.invalid> wrote:
> How well do mklinks work with services? I am not really a Windows
> administrator, so I have no idea.

I have no idea either as I have never used them together. But mklink
is a filesystem level feature AFAIK so I don't see why a Windows
service would know the difference between a link and the directory it
points to. If it did, that would make mklink pretty useless.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
Mike,

On 11/17/2021 7:16 PM, Michael B Allen wrote:
> On Wed, Nov 17, 2021 at 9:05 PM Mark Eggers
> <it...@yahoo.com.invalid> wrote:
>> CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
>> installation, and one configured for that particular service.
>>
>> Then to upgrade to a new Tomcat, you do the following:
>>
>> 1. Unpack the new reference version of Tomcat somewhere which becomes
>> CATALINA_HOME.
>>
>> 2. Create the new service-specific installation of Tomcat which becomes
>> CATALINA_BASE.
>>
>> All of the above can be done without disturbing the existing service.
>>
>> To upgrade, do the following:
>>
>> 1. Shut down the service
>> 2. Move the links
>> 3. Start up the service
>>
>> If things blow up in your face, then the roll back is really easy:
>>
>> 1. Shut down the service
>> 2. Restore the links
>> 3. Start up the service
> 
> This makes me realize my proposed bin/run.sh method is not really
> tuned for production. Indeed links could be used to great effect here.
> Windows has mklink /d <link> <targetdir> which is essentially the same
> as ln on *nix near as I can tell. Might help with issues like the
> catalina.policy file path in the registry when using the Windows
> service.
> 
> Mike

How well do mklinks work with services? I am not really a Windows 
administrator, so I have no idea.

It's just something to consider, where Windows operates almost, but not 
quite, entirely unlike Linux.

. . . just my two cents
/mde/

Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Michael B Allen <io...@gmail.com>.
On Wed, Nov 17, 2021 at 9:05 PM Mark Eggers
<it...@yahoo.com.invalid> wrote:
> CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat
> installation, and one configured for that particular service.
>
> Then to upgrade to a new Tomcat, you do the following:
>
> 1. Unpack the new reference version of Tomcat somewhere which becomes
> CATALINA_HOME.
>
> 2. Create the new service-specific installation of Tomcat which becomes
> CATALINA_BASE.
>
> All of the above can be done without disturbing the existing service.
>
> To upgrade, do the following:
>
> 1. Shut down the service
> 2. Move the links
> 3. Start up the service
>
> If things blow up in your face, then the roll back is really easy:
>
> 1. Shut down the service
> 2. Restore the links
> 3. Start up the service

This makes me realize my proposed bin/run.sh method is not really
tuned for production. Indeed links could be used to great effect here.
Windows has mklink /d <link> <targetdir> which is essentially the same
as ln on *nix near as I can tell. Might help with issues like the
catalina.policy file path in the registry when using the Windows
service.

Mike

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Mark Eggers <it...@yahoo.com.INVALID>.
On 11/17/2021 5:28 PM, jonmcalexander@wellsfargo.com.INVALID wrote:
> We export it. You have to make sure the setenv.sh is calling setenv.sh. it works fine for me.­
> 
> 
> Thanks,
> 
> 
> Sent with BlackBerry Work (www.blackberry.com)
> ________________________________
> From: Michael B Allen <io...@gmail.com>
> Sent: Nov 17, 2021 6:54 PM
> To: Tomcat Users List <us...@tomcat.apache.org>
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid> wrote:
>> I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.
> 
> Jon,
> 
> If you mean you're setting $CATALINA_BASE in setenv.sh, I don't think
> that will work because when you run $CATALINA_BASE/bin/startup.sh,
> $CATALINA_BASE won't be set yet and so it's going to set
> $CATALINA_BASE to $CATALINA_HOME and then source the
> $CATALINA_HOME/bin/setenv.sh and not the $CATALINA_BASE specific
> setenv.sh. I think that's what Chris was referring to in his first
> reply to you.
> 
> Although if I'm using a $CATALINA_BASE/bin/run.sh alternative to
> startup.sh like in my previous post, I would probably just put ALL the
> various environment variables (listed at the top of bin/catalina.sh)
> in there too. Using setenv.sh at that point would just be needlessly
> spreading config around.
> 
> The documentation currently seems to be targeting installations shared
> by multiple different users where $CATALINA_HOME and $CATALINA_BASE
> get set in the users environment such that different users can have
> different bases but share a common installation like in /usr/local or
> some such. Then you *would* want to put base specific stuff in
> $CATALINA_BASE/bin/setenv.sh. But IMO that's kind of a late 90's way
> of doing things. Nowadays, not only do people have their own machines,
> but they have multiple instances in VMs and private servers and docker
> and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh
> method is probably a little better for most cases (although I still
> need to study the Windows service use-case which is probably
> important).
> 
> Mike
> 
> --
> Michael B Allen
> Java Active Directory Integration
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$

On Linux with systemd, I put the following in the systemd file:

Environment=CATALINA_HOME=/home/tcadmin/Services/[sname]/CATALINA_HOME/
Environment=CATALINA_BASE=/home/tcadmin/Services/[sname]CATALINA_BASE/
Environment=CATALINA_PID=/var/run/tomcat/[sname].pid

where [sname] is the name of the service.

tcadmin is the unprivileged user that runs all the Tomcats on the system.

Everything else is set in 
/home/tcadmin/Services/[sname]/CATALINA_BASE/bin/setenv.sh

For the old style init.d systems, I put everything in:

/etc/sysconfig/[tomcatx]/[sname]

where [tomcatx] is the base version of Tomcat, and [sname] is the 
service name.

Then there is an init file for each service that reads the
appropriate /etc/sysconfig/[tomcatx]/[sname] file to set the up the 
environment.

CATALINA_HOME and CATALINA_BASE are links to an appropriate Tomcat 
installation, and one configured for that particular service.

Then to upgrade to a new Tomcat, you do the following:

1. Unpack the new reference version of Tomcat somewhere which becomes 
CATALINA_HOME.

2. Create the new service-specific installation of Tomcat which becomes 
CATALINA_BASE.

All of the above can be done without disturbing the existing service.

To upgrade, do the following:

1. Shut down the service
2. Move the links
3. Start up the service

If things blow up in your face, then the roll back is really easy:

1. Shut down the service
2. Restore the links
3. Start up the service

Since the CATALINA_BASE is linked to a version-specific directory, 
you'll have log files to figure out why things didn't go according to 
plan if you have to roll back.

Automate configuring your CATALINA_BASE setup with a couple of Ant 
build.xml files, a couple of property files, with an XSLT file or two, 
and configuring a new version of Tomcat takes a few seconds.

Version the property files to keep track of Tomcat updates, and you can 
keep track of what was changed, by whom, and when. All of that makes a 
sysadmin a happy camper.

Add more or less automation to taste.

This is of course only germane if you're running a traditional IS 
architecture.

. . . just my two cents
/mde/

RE: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
We export it. You have to make sure the setenv.sh is calling setenv.sh. it works fine for me.­


Thanks,


Sent with BlackBerry Work (www.blackberry.com)
________________________________
From: Michael B Allen <io...@gmail.com>
Sent: Nov 17, 2021 6:54 PM
To: Tomcat Users List <us...@tomcat.apache.org>
Subject: Re: How to *properly* create and use a CATALINA_BASE installation

On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid> wrote:
> I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.

Jon,

If you mean you're setting $CATALINA_BASE in setenv.sh, I don't think
that will work because when you run $CATALINA_BASE/bin/startup.sh,
$CATALINA_BASE won't be set yet and so it's going to set
$CATALINA_BASE to $CATALINA_HOME and then source the
$CATALINA_HOME/bin/setenv.sh and not the $CATALINA_BASE specific
setenv.sh. I think that's what Chris was referring to in his first
reply to you.

Although if I'm using a $CATALINA_BASE/bin/run.sh alternative to
startup.sh like in my previous post, I would probably just put ALL the
various environment variables (listed at the top of bin/catalina.sh)
in there too. Using setenv.sh at that point would just be needlessly
spreading config around.

The documentation currently seems to be targeting installations shared
by multiple different users where $CATALINA_HOME and $CATALINA_BASE
get set in the users environment such that different users can have
different bases but share a common installation like in /usr/local or
some such. Then you *would* want to put base specific stuff in
$CATALINA_BASE/bin/setenv.sh. But IMO that's kind of a late 90's way
of doing things. Nowadays, not only do people have their own machines,
but they have multiple instances in VMs and private servers and docker
and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh
method is probably a little better for most cases (although I still
need to study the Windows service use-case which is probably
important).

Mike

--
Michael B Allen
Java Active Directory Integration
https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPGSwU!4iBjG2OA7erMr6vPvbqVyxiEd3LfwnDYJHJSyYeYUf-BvIj0XsTET3jr1g4QVb95_R5ATTc$

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Michael B Allen <io...@gmail.com>.
On Wed, Nov 17, 2021 at 11:04 AM <jo...@wellsfargo.com.invalid> wrote:
> I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.

Jon,

If you mean you're setting $CATALINA_BASE in setenv.sh, I don't think
that will work because when you run $CATALINA_BASE/bin/startup.sh,
$CATALINA_BASE won't be set yet and so it's going to set
$CATALINA_BASE to $CATALINA_HOME and then source the
$CATALINA_HOME/bin/setenv.sh and not the $CATALINA_BASE specific
setenv.sh. I think that's what Chris was referring to in his first
reply to you.

Although if I'm using a $CATALINA_BASE/bin/run.sh alternative to
startup.sh like in my previous post, I would probably just put ALL the
various environment variables (listed at the top of bin/catalina.sh)
in there too. Using setenv.sh at that point would just be needlessly
spreading config around.

The documentation currently seems to be targeting installations shared
by multiple different users where $CATALINA_HOME and $CATALINA_BASE
get set in the users environment such that different users can have
different bases but share a common installation like in /usr/local or
some such. Then you *would* want to put base specific stuff in
$CATALINA_BASE/bin/setenv.sh. But IMO that's kind of a late 90's way
of doing things. Nowadays, not only do people have their own machines,
but they have multiple instances in VMs and private servers and docker
and so on. So I think the self-contained $CATALINA_BASE/bin/run.sh
method is probably a little better for most cases (although I still
need to study the Windows service use-case which is probably
important).

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

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


RE: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
Michael, 
-----Original Message-----
> From: Christopher Schultz <ch...@christopherschultz.net>
> Sent: Wednesday, November 17, 2021 9:43 AM
> To: users@tomcat.apache.org
> Subject: Re: How to *properly* create and use a CATALINA_BASE installation
> 
> Michael,
> 
> On 11/16/21 17:05, Michael B Allen wrote:
> >>
> https://urldefense.com/v3/__https://people.apache.org/*schultz/presen
> >>
> tations/ApacheCon*20NA*202020/Splitting*20Your*20Tomcat*20Installatio
> >> n.pdf__;fiUlJSUl!!F9svGWnIaVPGSwU!_kcg_WiI54imo-
> Pk9CgIH3DFhNeZ6MiQRzP
> >> vO3TKe8Um2xd0TTEljpBc1_gS2D0FwomA3A0$
> >
> > Thanks. That's what I'm looking for.
> >
> > Slightly related: Instead of setting environment variables in your
> > profile and running $CATALINA_HOME/bin/startup.sh, is there any reason
> > why we should not create a $CATALINA_BASE/bin/startup.sh like the
> > following?
> >
> > #!/bin/sh
> > export JRE_HOME=/path/to/jre/
> > export CATALINA_HOME=/path/to/tomcat/
> > export CATALINA_BASE=/path/to/tomcat-base/
> > ${CATALINA_HOME}/bin/catalina.sh run "$@"
> >
> > and use this instead?
> >
> > It seems to me this would completely separate the installation from
> > the host and environment.
> 
> I would not set CATALINA_BASE in my profile for a number of reasons -- the
> primary one being that I run multiple applications in separate Tomcats, so
> there is no one single CATALINA_BASE that I could set.
> 
> What you have above is, IMO, the "right" way to do things, except that I
> wouldn't use startup.sh -- I'd use a different script as not to conflict/confuse
> with the one that comes from Tomcat.
> 
> -chris
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org

This is why I use the setenv.sh file on Unix/Linux, setenv.bat on Windows, when not using as a services. If setup as a service on windows, I add the CATALINA_BASE to the JAVA OPTIONS section.

I, in my opinion, find it far easier to set my BASE in the setenv.sh for the instance I'm using. As Chris said, you can have multiple instances (BASEs) on a server.

Thanks,

Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Michael,

On 11/16/21 17:05, Michael B Allen wrote:
>> https://people.apache.org/~schultz/presentations/ApacheCon%20NA%202020/Splitting%20Your%20Tomcat%20Installation.pdf
> 
> Thanks. That's what I'm looking for.
> 
> Slightly related: Instead of setting environment variables in your
> profile and running $CATALINA_HOME/bin/startup.sh, is there any reason
> why we should not create a $CATALINA_BASE/bin/startup.sh like the
> following?
> 
> #!/bin/sh
> export JRE_HOME=/path/to/jre/
> export CATALINA_HOME=/path/to/tomcat/
> export CATALINA_BASE=/path/to/tomcat-base/
> ${CATALINA_HOME}/bin/catalina.sh run "$@"
> 
> and use this instead?
> 
> It seems to me this would completely separate the installation from
> the host and environment.

I would not set CATALINA_BASE in my profile for a number of reasons -- 
the primary one being that I run multiple applications in separate 
Tomcats, so there is no one single CATALINA_BASE that I could set.

What you have above is, IMO, the "right" way to do things, except that I 
wouldn't use startup.sh -- I'd use a different script as not to 
conflict/confuse with the one that comes from Tomcat.

-chris

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Michael B Allen <io...@gmail.com>.
> https://people.apache.org/~schultz/presentations/ApacheCon%20NA%202020/Splitting%20Your%20Tomcat%20Installation.pdf

Thanks. That's what I'm looking for.

Slightly related: Instead of setting environment variables in your
profile and running $CATALINA_HOME/bin/startup.sh, is there any reason
why we should not create a $CATALINA_BASE/bin/startup.sh like the
following?

#!/bin/sh
export JRE_HOME=/path/to/jre/
export CATALINA_HOME=/path/to/tomcat/
export CATALINA_BASE=/path/to/tomcat-base/
${CATALINA_HOME}/bin/catalina.sh run "$@"

and use this instead?

It seems to me this would completely separate the installation from
the host and environment.

Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Michael,

On 11/15/21 17:23, Michael B Allen wrote:
> On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
> <ch...@christopherschultz.net> wrote:
>>> conf
>>> All of the conf files.
>>
>> Specifically, you'll want server.xml and web.xml. You can also choose to
>> customize context.xml, and put any [engine]/[host]/[webapp].xml
>> deployment descriptors there.
> 
> Hi chros,
> 
> Ok, so then the minimum required is server.xml and web.xml?
> 
> And then there are optional files like context.xml? Are all of the
> other files also optional and completely overwrite settings like
> tomcat-users.xml or only some?
> 
> I have confirmed that adding only web.xml alone resolves the issue
> completely. I no longer get 404's and the application works. But I
> would like to further understand this as much as possible to document
> it for my customers.

https://people.apache.org/~schultz/presentations/ApacheCon%20NA%202020/Splitting%20Your%20Tomcat%20Installation.pdf

-chris

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


Re: How to *properly* create and use a CATALINA_BASE installation

Posted by Michael B Allen <io...@gmail.com>.
On Mon, Nov 15, 2021 at 4:31 PM Christopher Schultz
<ch...@christopherschultz.net> wrote:
> > conf
> > All of the conf files.
>
> Specifically, you'll want server.xml and web.xml. You can also choose to
> customize context.xml, and put any [engine]/[host]/[webapp].xml
> deployment descriptors there.

Hi chros,

Ok, so then the minimum required is server.xml and web.xml?

And then there are optional files like context.xml? Are all of the
other files also optional and completely overwrite settings like
tomcat-users.xml or only some?

I have confirmed that adding only web.xml alone resolves the issue
completely. I no longer get 404's and the application works. But I
would like to further understand this as much as possible to document
it for my customers.

Thanks,
Mike

-- 
Michael B Allen
Java Active Directory Integration
http://www.ioplex.com/

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


Re: How to Upgrade Tomcat

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Rakesh,

First: please don't hijack threads (you replied to a thread called "How 
to *properly* create and use a CATALINA_BASE installation")

Second: it's ironic that you replied to this particular thread, because 
one of my recommendations is to always run with CATALINA_HOME and 
CATALINA_BASE separate, because it makes upgrades (and downgrades, if 
necessary) quite a bit easier.

I'd have a look here for some more information:
https://people.apache.org/~schultz/presentations/ApacheCon%20NA%202020/Splitting%20Your%20Tomcat%20Installation.pdf

On 11/15/21 16:45, rakesh meka wrote:
> Need guidance or help I order to upgrade the current tomcat version on the
> server to later version where I have already deployed an application on
> windows server and do not want to loss any data.
> 
> Current version of tomcat : 8.5.23
> 
> Need to upgrade to either : 8.5.73 or 9.0.54

I would recommend to upgrade to 8.5.73 and not go to Tomcat 9.0.x quite 
yet. The upgrade from 8.5.23 -> 8.5.73 should have very few surprises, 
but you should definitely read this before doing anything:

http://tomcat.apache.org/migration-85.html#Upgrading_8.5.x

If you have questions, please start a new post to 
users@tomcat.apache.org with a new subject.

-chris

> On Tue, 16 Nov, 2021, 3:01 am Christopher Schultz, <
> chris@christopherschultz.net> wrote:
> 
>> Jon,
>>
>> On 11/15/21 15:20, jonmcalexander@wellsfargo.com.INVALID wrote:
>>> Files Required in CATALINA_BASE:
>>>
>>> bin
>>> Only shell scripts or batch files. Make sure that setenv.sh or
>>> setenv.bat sets and passes the CATALINA_BASE and CATALINA_HOME
>>> locations properly.
>> You can't use CATALINA_BASE/bin/setenv.sh to set CATALINA_BASE,
>> otherwise this file will never be found ;)
>>
>> setenv.sh should be used for things like CATALINA_OPTS.
>>
>>> conf
>>> All of the conf files.
>>
>> Specifically, you'll want server.xml and web.xml. You can also choose to
>> customize context.xml, and put any [engine]/[host]/[webapp].xml
>> deployment descriptors there.
>>
>>> lib
>>> Only .jar files needed by your Instance, not necessarily the
>>> application(s), and definitely not any of the jars from
>>> CATALINA_HOME
>> This should almost always be empty except maybe for a JDBC driver.
>>
>>> logs (if in this location)
>>
>> ... and they should be, unless you have some exotic logging going on.
>>
>>> webapps (if in this location)
>>
>> ... and they should be, unless you are using
>> CATALINA_BASE/conf/[engine]/[host]/[webapp].xml files.
>>
>>> temp and work
>>
>> These must additionally be *writable* by Tomcat.
>>
>> -chros
>>
>>>> -----Original Message-----
>>>> From: Michael B Allen <io...@gmail.com>
>>>> Sent: Monday, November 15, 2021 2:16 PM
>>>> To: users@tomcat.apache.org
>>>> Subject: How to *properly* create and use a CATALINA_BASE installation
>>>>
>>>> Hi,
>>>>
>>>> What $CATALINA_HOME/conf/ files should be copied into
>>>> $CATALINA_BASE?
>>>>
>>>> RUNNING.txt just says:
>>>>
>>>> * conf - Server configuration files (including server.xml)
>>>>
>>>> So it's multiple fileS but not necessarily all if server.xml is
>> explicitly included?
>>>>
>>>> Ideally I would think it should be only files that need to be modified
>> since
>>>> that seems to be the point of using $CATALINA_BASE. Is this correct?
>>>>
>>>> I'm trying to use $CATALINA_BASE just because it seems like the proper
>> way
>>>> to setup Tomcat in general.
>>>>
>>>> Without $CATALINA_BASE everything works as near as I can tell.
>>>>
>>>> But if I change $CATALINA_BASE to be different from $CATALINA_HOME in
>>>> my startup bat like:
>>>>
>>>> $CATALINA_HOME/bin/xstart.bat:
>>>> SETLOCAL
>>>>
>>>> set JRE_HOME=%ProgramFiles%\Java\jre1.8.0_311
>>>> set CATALINA_HOME=C:\path\to\tomcat
>>>> set CATALINA_BASE=C:\path\to\tomcat-base
>>>>
>>>> "%CATALINA_HOME%\bin\catalina.bat" run %1 %2 %3 %4 %5 %6 %7 %8 %9
>>>>
>>>> And then in tomcat-base I have:
>>>>
>>>> bin\tomcat-juli.jar
>>>> conf\keystore.jks
>>>> conf\server.xml
>>>>
>>>> The server.xml is stock except for the following:
>>>>
>>>>       <Connector
>>>>           port="8443"
>>>>           protocol="org.apache.coyote.http11.Http11NioProtocol"
>>>>           scheme="https"
>>>>           secure="true"
>>>>           SSLEnabled="true">
>>>>           <SSLHostConfig>
>>>>               <Certificate
>>>>                   certificateKeystoreFile="conf/keystore.jks"
>>>>                   certificateKeystorePassword="as1busiw19"/>
>>>>           </SSLHostConfig>
>>>>       </Connector>
>>>>
>>>> conf\tomcat-users.xml
>>>> conf\Catalina\localhost\manager.xml
>>>> logs\localhost_access_log.2021-11-15.txt
>>>> temp\
>>>> webapps\myapp\<mywebappfiles>
>>>>
>>>> Note: There is no myapp\WEB-INF\context.xml
>>>>
>>>> webapps\manager\<managerfiles>
>>>>
>>>> Tomcat starts up ok and Tomcat Manager works. I can see myapp in the
>>>> manager which claims it's deployed and running.
>>>>
>>>> But trying to access /myapp results in:
>>>>
>>>>       404 Not Found: The origin server did not find a current
>> representation for
>>>> the target resource or is not willing to disclose that one exists.
>>>>
>>>> I can un-deploy /myapp and re-deploy it through the manager and again,
>>>> nothing but 404.
>>>>
>>>> Doesn't work under HTTPS either (and HTTPS works without using
>>>> $CATALINA_BASE).
>>>>
>>>> What could be the problem here?
>>>>
>>>> I used the following to create a symbolic link to the tomcat directory:
>>>>
>>>> cmd>mklink /d tomcat apache-tomcat-9.0.54
>>>>
>>>> Is this ok?
>>>>
>>>> I'm using Tomcat 9.0.54 32 bit on Windows Server 2016 64 bit. The native
>>>> runtime DLL fails to load because it's built for 32bit. But this seems
>> to fallback
>>>> to the Java runtime just fine. Is this somehow a problem?
>>>>
>>>> Do I need a deployment context xml?
>>>>
>>>> I'm a little stumped by this. I don't normally use Tomcat but I just
>> wanted to
>>>> create an "Application Note" about how to properly use my product with
>>>> Tomcat. So I'm really interested in how this all is supposed to work
>> and not so
>>>> much just seeing it work.
>>>>
>>>> Thanks,
>>>>
>>>> Mike
>>>> --
>>>> Michael B Allen
>>>> Java Active Directory Integration
>>>> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
>>>> SwU!_6VQfOm0BicBKqHX5YRO8TPWj-
>>>> CbBzOJLHUmvYMkxoFKta0WfhOFzKojClKr8XG5MwyZgig$
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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
>>
>>
> 

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


Re: How to Upgrade Tomcat

Posted by rakesh meka <ra...@gmail.com>.
Hi All,

Need guidance or help I order to upgrade the current tomcat version on the
server to later version where I have already deployed an application on
windows server and do not want to loss any data.


Current version of tomcat : 8.5.23

Need to upgrade to either : 8.5.73 or 9.0.54



On Tue, 16 Nov, 2021, 3:01 am Christopher Schultz, <
chris@christopherschultz.net> wrote:

> Jon,
>
> On 11/15/21 15:20, jonmcalexander@wellsfargo.com.INVALID wrote:
> > Files Required in CATALINA_BASE:
> >
> > bin
> > Only shell scripts or batch files. Make sure that setenv.sh or
> > setenv.bat sets and passes the CATALINA_BASE and CATALINA_HOME
> > locations properly.
> You can't use CATALINA_BASE/bin/setenv.sh to set CATALINA_BASE,
> otherwise this file will never be found ;)
>
> setenv.sh should be used for things like CATALINA_OPTS.
>
> > conf
> > All of the conf files.
>
> Specifically, you'll want server.xml and web.xml. You can also choose to
> customize context.xml, and put any [engine]/[host]/[webapp].xml
> deployment descriptors there.
>
> > lib
> > Only .jar files needed by your Instance, not necessarily the
> > application(s), and definitely not any of the jars from
> > CATALINA_HOME
> This should almost always be empty except maybe for a JDBC driver.
>
> > logs (if in this location)
>
> ... and they should be, unless you have some exotic logging going on.
>
> > webapps (if in this location)
>
> ... and they should be, unless you are using
> CATALINA_BASE/conf/[engine]/[host]/[webapp].xml files.
>
> > temp and work
>
> These must additionally be *writable* by Tomcat.
>
> -chros
>
> >> -----Original Message-----
> >> From: Michael B Allen <io...@gmail.com>
> >> Sent: Monday, November 15, 2021 2:16 PM
> >> To: users@tomcat.apache.org
> >> Subject: How to *properly* create and use a CATALINA_BASE installation
> >>
> >> Hi,
> >>
> >> What $CATALINA_HOME/conf/ files should be copied into
> >> $CATALINA_BASE?
> >>
> >> RUNNING.txt just says:
> >>
> >> * conf - Server configuration files (including server.xml)
> >>
> >> So it's multiple fileS but not necessarily all if server.xml is
> explicitly included?
> >>
> >> Ideally I would think it should be only files that need to be modified
> since
> >> that seems to be the point of using $CATALINA_BASE. Is this correct?
> >>
> >> I'm trying to use $CATALINA_BASE just because it seems like the proper
> way
> >> to setup Tomcat in general.
> >>
> >> Without $CATALINA_BASE everything works as near as I can tell.
> >>
> >> But if I change $CATALINA_BASE to be different from $CATALINA_HOME in
> >> my startup bat like:
> >>
> >> $CATALINA_HOME/bin/xstart.bat:
> >> SETLOCAL
> >>
> >> set JRE_HOME=%ProgramFiles%\Java\jre1.8.0_311
> >> set CATALINA_HOME=C:\path\to\tomcat
> >> set CATALINA_BASE=C:\path\to\tomcat-base
> >>
> >> "%CATALINA_HOME%\bin\catalina.bat" run %1 %2 %3 %4 %5 %6 %7 %8 %9
> >>
> >> And then in tomcat-base I have:
> >>
> >> bin\tomcat-juli.jar
> >> conf\keystore.jks
> >> conf\server.xml
> >>
> >> The server.xml is stock except for the following:
> >>
> >>      <Connector
> >>          port="8443"
> >>          protocol="org.apache.coyote.http11.Http11NioProtocol"
> >>          scheme="https"
> >>          secure="true"
> >>          SSLEnabled="true">
> >>          <SSLHostConfig>
> >>              <Certificate
> >>                  certificateKeystoreFile="conf/keystore.jks"
> >>                  certificateKeystorePassword="as1busiw19"/>
> >>          </SSLHostConfig>
> >>      </Connector>
> >>
> >> conf\tomcat-users.xml
> >> conf\Catalina\localhost\manager.xml
> >> logs\localhost_access_log.2021-11-15.txt
> >> temp\
> >> webapps\myapp\<mywebappfiles>
> >>
> >> Note: There is no myapp\WEB-INF\context.xml
> >>
> >> webapps\manager\<managerfiles>
> >>
> >> Tomcat starts up ok and Tomcat Manager works. I can see myapp in the
> >> manager which claims it's deployed and running.
> >>
> >> But trying to access /myapp results in:
> >>
> >>      404 Not Found: The origin server did not find a current
> representation for
> >> the target resource or is not willing to disclose that one exists.
> >>
> >> I can un-deploy /myapp and re-deploy it through the manager and again,
> >> nothing but 404.
> >>
> >> Doesn't work under HTTPS either (and HTTPS works without using
> >> $CATALINA_BASE).
> >>
> >> What could be the problem here?
> >>
> >> I used the following to create a symbolic link to the tomcat directory:
> >>
> >> cmd>mklink /d tomcat apache-tomcat-9.0.54
> >>
> >> Is this ok?
> >>
> >> I'm using Tomcat 9.0.54 32 bit on Windows Server 2016 64 bit. The native
> >> runtime DLL fails to load because it's built for 32bit. But this seems
> to fallback
> >> to the Java runtime just fine. Is this somehow a problem?
> >>
> >> Do I need a deployment context xml?
> >>
> >> I'm a little stumped by this. I don't normally use Tomcat but I just
> wanted to
> >> create an "Application Note" about how to properly use my product with
> >> Tomcat. So I'm really interested in how this all is supposed to work
> and not so
> >> much just seeing it work.
> >>
> >> Thanks,
> >>
> >> Mike
> >> --
> >> Michael B Allen
> >> Java Active Directory Integration
> >> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
> >> SwU!_6VQfOm0BicBKqHX5YRO8TPWj-
> >> CbBzOJLHUmvYMkxoFKta0WfhOFzKojClKr8XG5MwyZgig$
> >>
> >> ---------------------------------------------------------------------
> >> 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: How to *properly* create and use a CATALINA_BASE installation

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Jon,

On 11/15/21 15:20, jonmcalexander@wellsfargo.com.INVALID wrote:
> Files Required in CATALINA_BASE:
> 
> bin
> Only shell scripts or batch files. Make sure that setenv.sh or
> setenv.bat sets and passes the CATALINA_BASE and CATALINA_HOME
> locations properly.
You can't use CATALINA_BASE/bin/setenv.sh to set CATALINA_BASE, 
otherwise this file will never be found ;)

setenv.sh should be used for things like CATALINA_OPTS.

> conf
> All of the conf files.

Specifically, you'll want server.xml and web.xml. You can also choose to 
customize context.xml, and put any [engine]/[host]/[webapp].xml 
deployment descriptors there.

> lib
> Only .jar files needed by your Instance, not necessarily the
> application(s), and definitely not any of the jars from
> CATALINA_HOME
This should almost always be empty except maybe for a JDBC driver.

> logs (if in this location)

... and they should be, unless you have some exotic logging going on.

> webapps (if in this location)

... and they should be, unless you are using 
CATALINA_BASE/conf/[engine]/[host]/[webapp].xml files.

> temp and work

These must additionally be *writable* by Tomcat.

-chros

>> -----Original Message-----
>> From: Michael B Allen <io...@gmail.com>
>> Sent: Monday, November 15, 2021 2:16 PM
>> To: users@tomcat.apache.org
>> Subject: How to *properly* create and use a CATALINA_BASE installation
>>
>> Hi,
>>
>> What $CATALINA_HOME/conf/ files should be copied into
>> $CATALINA_BASE?
>>
>> RUNNING.txt just says:
>>
>> * conf - Server configuration files (including server.xml)
>>
>> So it's multiple fileS but not necessarily all if server.xml is explicitly included?
>>
>> Ideally I would think it should be only files that need to be modified since
>> that seems to be the point of using $CATALINA_BASE. Is this correct?
>>
>> I'm trying to use $CATALINA_BASE just because it seems like the proper way
>> to setup Tomcat in general.
>>
>> Without $CATALINA_BASE everything works as near as I can tell.
>>
>> But if I change $CATALINA_BASE to be different from $CATALINA_HOME in
>> my startup bat like:
>>
>> $CATALINA_HOME/bin/xstart.bat:
>> SETLOCAL
>>
>> set JRE_HOME=%ProgramFiles%\Java\jre1.8.0_311
>> set CATALINA_HOME=C:\path\to\tomcat
>> set CATALINA_BASE=C:\path\to\tomcat-base
>>
>> "%CATALINA_HOME%\bin\catalina.bat" run %1 %2 %3 %4 %5 %6 %7 %8 %9
>>
>> And then in tomcat-base I have:
>>
>> bin\tomcat-juli.jar
>> conf\keystore.jks
>> conf\server.xml
>>
>> The server.xml is stock except for the following:
>>
>>      <Connector
>>          port="8443"
>>          protocol="org.apache.coyote.http11.Http11NioProtocol"
>>          scheme="https"
>>          secure="true"
>>          SSLEnabled="true">
>>          <SSLHostConfig>
>>              <Certificate
>>                  certificateKeystoreFile="conf/keystore.jks"
>>                  certificateKeystorePassword="as1busiw19"/>
>>          </SSLHostConfig>
>>      </Connector>
>>
>> conf\tomcat-users.xml
>> conf\Catalina\localhost\manager.xml
>> logs\localhost_access_log.2021-11-15.txt
>> temp\
>> webapps\myapp\<mywebappfiles>
>>
>> Note: There is no myapp\WEB-INF\context.xml
>>
>> webapps\manager\<managerfiles>
>>
>> Tomcat starts up ok and Tomcat Manager works. I can see myapp in the
>> manager which claims it's deployed and running.
>>
>> But trying to access /myapp results in:
>>
>>      404 Not Found: The origin server did not find a current representation for
>> the target resource or is not willing to disclose that one exists.
>>
>> I can un-deploy /myapp and re-deploy it through the manager and again,
>> nothing but 404.
>>
>> Doesn't work under HTTPS either (and HTTPS works without using
>> $CATALINA_BASE).
>>
>> What could be the problem here?
>>
>> I used the following to create a symbolic link to the tomcat directory:
>>
>> cmd>mklink /d tomcat apache-tomcat-9.0.54
>>
>> Is this ok?
>>
>> I'm using Tomcat 9.0.54 32 bit on Windows Server 2016 64 bit. The native
>> runtime DLL fails to load because it's built for 32bit. But this seems to fallback
>> to the Java runtime just fine. Is this somehow a problem?
>>
>> Do I need a deployment context xml?
>>
>> I'm a little stumped by this. I don't normally use Tomcat but I just wanted to
>> create an "Application Note" about how to properly use my product with
>> Tomcat. So I'm really interested in how this all is supposed to work and not so
>> much just seeing it work.
>>
>> Thanks,
>>
>> Mike
>> --
>> Michael B Allen
>> Java Active Directory Integration
>> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
>> SwU!_6VQfOm0BicBKqHX5YRO8TPWj-
>> CbBzOJLHUmvYMkxoFKta0WfhOFzKojClKr8XG5MwyZgig$
>>
>> ---------------------------------------------------------------------
>> 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: How to *properly* create and use a CATALINA_BASE installation

Posted by jo...@wellsfargo.com.INVALID.
Files Required in CATALINA_BASE:

bin
	Only shell scripts or batch files. Make sure that setenv.sh or setenv.bat sets and passes the CATALINA_BASE and CATALINA_HOME locations properly.

conf
	All of the conf files.

lib
	Only .jar files needed by your Instance, not necessarily the application(s), and definitely not any of the jars from CATALINA_HOME

logs (if in this location)

webapps (if in this location)

temp and work

Dream * Excel * Explore * Inspire
Jon McAlexander
Infrastructure Engineer
Asst Vice President

Middleware Product Engineering
Enterprise CIO | EAS | Middleware | Infrastructure Solutions

8080 Cobblestone Rd | Urbandale, IA 50322
MAC: F4469-010
Tel 515-988-2508 | Cell 515-988-2508

jonmcalexander@wellsfargo.com
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.

> -----Original Message-----
> From: Michael B Allen <io...@gmail.com>
> Sent: Monday, November 15, 2021 2:16 PM
> To: users@tomcat.apache.org
> Subject: How to *properly* create and use a CATALINA_BASE installation
> 
> Hi,
> 
> What $CATALINA_HOME/conf/ files should be copied into
> $CATALINA_BASE?
> 
> RUNNING.txt just says:
> 
> * conf - Server configuration files (including server.xml)
> 
> So it's multiple fileS but not necessarily all if server.xml is explicitly included?
> 
> Ideally I would think it should be only files that need to be modified since
> that seems to be the point of using $CATALINA_BASE. Is this correct?
> 
> I'm trying to use $CATALINA_BASE just because it seems like the proper way
> to setup Tomcat in general.
> 
> Without $CATALINA_BASE everything works as near as I can tell.
> 
> But if I change $CATALINA_BASE to be different from $CATALINA_HOME in
> my startup bat like:
> 
> $CATALINA_HOME/bin/xstart.bat:
> SETLOCAL
> 
> set JRE_HOME=%ProgramFiles%\Java\jre1.8.0_311
> set CATALINA_HOME=C:\path\to\tomcat
> set CATALINA_BASE=C:\path\to\tomcat-base
> 
> "%CATALINA_HOME%\bin\catalina.bat" run %1 %2 %3 %4 %5 %6 %7 %8 %9
> 
> And then in tomcat-base I have:
> 
> bin\tomcat-juli.jar
> conf\keystore.jks
> conf\server.xml
> 
> The server.xml is stock except for the following:
> 
>     <Connector
>         port="8443"
>         protocol="org.apache.coyote.http11.Http11NioProtocol"
>         scheme="https"
>         secure="true"
>         SSLEnabled="true">
>         <SSLHostConfig>
>             <Certificate
>                 certificateKeystoreFile="conf/keystore.jks"
>                 certificateKeystorePassword="as1busiw19"/>
>         </SSLHostConfig>
>     </Connector>
> 
> conf\tomcat-users.xml
> conf\Catalina\localhost\manager.xml
> logs\localhost_access_log.2021-11-15.txt
> temp\
> webapps\myapp\<mywebappfiles>
> 
> Note: There is no myapp\WEB-INF\context.xml
> 
> webapps\manager\<managerfiles>
> 
> Tomcat starts up ok and Tomcat Manager works. I can see myapp in the
> manager which claims it's deployed and running.
> 
> But trying to access /myapp results in:
> 
>     404 Not Found: The origin server did not find a current representation for
> the target resource or is not willing to disclose that one exists.
> 
> I can un-deploy /myapp and re-deploy it through the manager and again,
> nothing but 404.
> 
> Doesn't work under HTTPS either (and HTTPS works without using
> $CATALINA_BASE).
> 
> What could be the problem here?
> 
> I used the following to create a symbolic link to the tomcat directory:
> 
> cmd>mklink /d tomcat apache-tomcat-9.0.54
> 
> Is this ok?
> 
> I'm using Tomcat 9.0.54 32 bit on Windows Server 2016 64 bit. The native
> runtime DLL fails to load because it's built for 32bit. But this seems to fallback
> to the Java runtime just fine. Is this somehow a problem?
> 
> Do I need a deployment context xml?
> 
> I'm a little stumped by this. I don't normally use Tomcat but I just wanted to
> create an "Application Note" about how to properly use my product with
> Tomcat. So I'm really interested in how this all is supposed to work and not so
> much just seeing it work.
> 
> Thanks,
> 
> Mike
> --
> Michael B Allen
> Java Active Directory Integration
> https://urldefense.com/v3/__http://www.ioplex.com/__;!!F9svGWnIaVPG
> SwU!_6VQfOm0BicBKqHX5YRO8TPWj-
> CbBzOJLHUmvYMkxoFKta0WfhOFzKojClKr8XG5MwyZgig$
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org