Upgrading Apache Tomcat (Windows)

Kent DyerAppl Systems Administrator - Assistant Vice President
CERTIFIED EXPERT
Published:
Upgrading Tomcat –
There are a couple of methods to upgrade Tomcat

is to use The Apache Installer
is to download and unzip and run the services.bat remove|install Tomcat6

Because of the App that we are working with, we can only use Tomcat 6.

Note: Care should be taken by the installer to address proper notification, testing and there could be variations to doing this process.

Why upgrade?  There can be many reasons and just to keep up-to-date is not always the best reason to do so.  However, reading the Apache Tomcat Change Log and the fact that there have been many releases since the version that I am going to show below which address memory, cpu and other components when running on the server.

From http://tomcat.apache.org/tomcat-6.0-doc/changelog.html we can find some compelling reasons as to why we are going to upgrade:
50306: New StuckThreadDetectionValve to detect requests that take a long time to process, which might indicate that their processing threads are stuck. Based on a patch provided by TomLu. (kkolinko)
Add denyStatus attribute to RequestFilterValve (RemoteAddrValve, RemoteHostValve valves). It allows to use different HTTP response code when rejecting denied request. E.g. 404 instead of 403. (kkolinko)
52850: Extend memory leak prevention and detection code to work with IBM as well as Oracle JVMs. Based on a patch provided by Rohit Kelapure. (kkolinko)
52858: Fix high CPU load with SSL, NIO and sendfile when client breaks the connection before reading all the requested data. (fhanik/kkolinko)
Which Version am I running?  Probably the easiest way to see the Apache Version is to open the Properties:Tomcat Version
Before we start... Backup, backup, backup..  Did I say backup?  Take the time to do this – it will save you heartburn and headaches later.

Go to the Java Tab Java Taband copy off the Java Options of the settings you may have made (paste into a notepad and save) – since this is not a tuning/tweaking tutorial, that is another discussion.

Copy the Tomcat folder as a copy of itself > e.g. D:\Tomcat6 as a copy into D:\Tomcat6-old
Note 1: Be sure you have enough free space on the drive – clear out logs and stuff as necessary
Note 2: If you do not want to see possible messages about in use files, stop the tomcat6 service first
Note 3: It is a poor practice to install Web Services on the same volume as your OS – that should be common knowledge.  I know, I know..  My screen pics show C:\tomcat6 in them..  I did not build out this server that I did this on..

Can’t I just take the installer (.exe) from tomcat.apache.org and install and upgrade?  Unfortunately, this is not the case as we will discover below.

Possible scenarios:
Trying to run the Apache Installer with the current Service up-and-running and going into the same folder:
Directory already existsClick OK
AbortYou will have to abort.. close Tomcat6w.exe by right-clicking on the app in the tray and choosing exitTrayScenario 2, let’s stop our monitors and stop the Apache Service:
Cannot installOK..  Let’s uninstall The Application – Add/remove or Programs and Features..
Remove confirmationStop here..  We are going to click No..  Otherwise, you will have to re-deploy war files, settings, etc. to your server.

Complete the uninstall..

Start the install of the new version of the software..
Install Over folderClick OK..

Awesome!  Service installs and completes..

Check http://localhost and Manager…
tomcat pageLet’s check a couple of other things:
Uh oh..No Db ConnectionSince I have done this before..  Copy sqljdbc4.jar from /tomcat6-old/lib to the /tomcat6/lib folder..
Copy /tomcat6-old/conf/server.xml to /tomcat6/conf/
Restart Apache Tomcat services and check connectivity again.
Wait for services to come back online..  Re-enable monitors..  We are done!!
Final version checkAfter the systems comes back online, watch the Tomcat install for memory and CPU usage.
0
21,205 Views
Kent DyerAppl Systems Administrator - Assistant Vice President
CERTIFIED EXPERT

Comments (4)

TolomirAdministrator
CERTIFIED EXPERT
Top Expert 2005

Commented:
just a remark, whenever I upgrade tomcat I always look for the latest java version.

so basically I stop tomcatm, save the webapps and config folder. deinstall tomcat, install latest (java6 or java7), install tomcat, copy the webapps and config folder to their former location.

I always make sure to copy the latest tcnative-1.dll file to the tomcat/bin folder. This is needed when you install tomcat on a server without access to the internet.

apart from that good article,
Tolomir
Shashikanth PSecurity Consultant and Administator

Commented:
hi

I have upgrading Apache Tomcat 9.0.0.M3 to 9.0.0.M21 i.e latest version .

I am also getting the above  errors but i IGNORE the two steps but my tomcat has successfully upgraded .

Is there  any issue  in my up gradation process please let me know .
How to upgrade Apache Tomact 6.0.35 to 6.0.50? could you please tell me the steps.  

am new to Apache tomcat please tell me the steps clearly and correctly.


these below vulnerabilities found in the server.

CVE-2014-0075 CVE-2014-0096 CVE-2014-0099 CVE-2014-0119  so that need to upgrade Apache Tomcat server.Please help me anyone.
Thanks Kent

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.