If my current Tomcat is installed in
/home/tomcat/dir1/apache-tomcat-8.5.9
and then I install the latest Tomcat in
/home/tomcat/dir1/apache-tomcat-8.5.15
how does Apache web server know to connect to the newer version of Tomcat? Is
this established by the definition of CATALINA_HOME in .bash_profile? Or, some
other way?
Can I install both Tomcat versions side by side and switch between them to
verify everything works fine with the newer Tomcat before deleting the older
Tomcat?
>
> On May 17, 2017 at 3:58 PM Daniel Savard <[email protected]> wrote:
>
> 2017-05-17 12:58 GMT-04:00 Richard Huntrods <[email protected]>:
>
> > >
> > On 16/05/2017 17:18, Igal @ Lucee.org wrote:
> > >
> >
> > > > >
> > > > > > >
> > > > On 5/16/2017 8:27 AM, Kreuser, Peter wrote:
> > > >
> > > > >
> > > >
> > > > > > > > >
> > > > > I'd say a more robust (and the documented way) is
> > > > > to use a Tomcat-Home
> > > > > directory and a Tomcat-Base Directory.
> > > > >
> > > > > $CATALINA_HOME holds the actual distributed
> > > > > Tomcat-"Binaries" (ZIP/TGZ),
> > > > > $CATALINA_BASE holds your adapted config, libs
> > > > > and webapps.
> > > > >
> > > > > This way you can just exchange the CATALINA_HOME
> > > > > with a new version
> > > > > (say 8.5.15) and restart Tomcat. In case there
> > > > > are differences in configs
> > > > > between versions, adapt your conf using
> > > > > https://tomcat.apache.org/migr
> > > > >
> > > > > ation-85.html#Tomcat_8.5.x_configuration_file_differences
> > > > >
> > > > > > > > >
> > > > I agree that separating the CATALINA_HOME from
> > > > CATALINA_BASE is a much
> > > > better setup, but if Tomcat was not set up like that
> > > > already then for a
> > > > minor upgrade this complicates the process.
> > > >
> > > > The simplest way to upgrade is the one I documented.
> > > >
> > > > > > >
> > > That simple approach is incomplete. It assumes that:
> > > a) the JARs in $CATALINA_HOME/bin haven't changed
> > > b) the names of the JARs in $CATALINA_HOME/lib haven't changed
> > > c) no configuration changes are required.
> > >
> > > a) sometimes happens
> > >
> > > b) happens when the JDT compiler is updated
> > >
> > > c) can be checked via the migration guides
> > >
> > > Mark
> > >
> > > Well, I just upgraded my servers from Tomcat 8..5.12 to
> > > 8.5.14. The
> > > complex way is to create a new tomcat directory for the new
> > > version, then
> > > rename webapps to webapps.orig and create a new webapps
> > > directory to hold
> > > my war files. Then compare all the config files and make
> > > appropriate
> > > changes to the stock config files, then test. This takes a
> > > while.
> > >
> > > > >
> > So for the minor change from 12 to 14, I decided to try a new way.
> > On my
> > windows devel box, I unzipped a new download of 12 and a new
> > download of 14
> > into their own new directories, then compared all the files in both
> > (yay
> > for the ancient program "windiff"). I then built a batch file to
> > copy only
> > the changed files and tested this. Once satisfied, I built a shell
> > script
> > to make the same changes on my devel unix server, and tested this.
> > Once I
> > was sure it worked without any problems, I ported the script (and
> > virgin
> > 8.5.14 directory) to my production servers. On scheduled
> > maintenance I shut
> > down each tomcat 12, ran the script and then restarted tomcat. All
> > worked
> > perfectly.
> >
> > Here's the file changes from 8.5.12 to 8.5.14, no including the
> > changes to
> > "webapps" which I don't use:
> >
> > #!/bin/sh
> >
> > > > >
> > > #
> > >
> > > # update files in tomcat 8.5.12 to 8.5.14
> > > #
> > >
> > > # when done, rename apache-tomcat-8.5.12 to
> > > apache-tomcat-8.5.14
> > >
> > > # then fix the symbolic link and restart tomcat
> > > #
> > >
> > > cp ./apache-tomcat-8.5.14/RELEASE-NOTES
> > > ../apps/apache-tomcat-8.5.12
> > > cp ./apache-tomcat-8.5.14/bin/bootstrap.jar
> > > ../apps/apache-tomcat-8.5.12/bin
> > > cp ./apache-tomcat-8.5.14/bin/tomcat-juli.jar
> > > ../apps/apache-tomcat-8.5.12/bin
> > > cp ./apache-tomcat-8.5.14/lib/annotations-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/catalina-ant.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/catalina-ha.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/catalina-storeconfig.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/catalina-tribes.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/catalina.jar
> > > ../apps/apache-tomcat-8.5.12/l
> > > ib
> > > cp ./apache-tomcat-8.5.14/lib/el-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/jasper-el.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/jasper.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/jaspic-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/jsp-api.jar
> > > ../apps/apache-tomcat-8.5.12/l
> > > ib
> > > cp ./apache-tomcat-8.5.14/lib/servlet-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-coyote.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-dbcp.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-i18n-es.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-i18n-fr.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-i18n-ja.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-jdbc.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-jni.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-util-scan.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-util.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/tomcat-websocket.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > > cp ./apache-tomcat-8.5.14/lib/websocket-api.jar
> > > ../apps/apache-tomcat-8.5.12/lib
> > >
> > > > >
> > ---
> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus
> >
> > >
> Maybe a useless comment. However I upgraded from 8.0 to 8.5. I have both a
> CATALINA_HOME and CATALINA_BASE and the upgrade was really easy and
> summarizes almost entierly in changes for the new configuration syntax in
> the server.xml file. Upgrading from a release to another is almost a no
> brainer, as well as upgrading to a new Java version.
>
> It may be a little more work to start with to setup two separated
> filetree,
> but on the long run, it pays. I have to maintain and support about 70
> instances of Tomcat and a dozen of applications as a sideline job.
>
> -----------------
> Daniel Savard
>