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.
Care should be taken by the installer to address proper notification, testing and there could be variations to doing this process.
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.
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:
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
and 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
Be sure you have enough free space on the drive – clear out logs and stuff as necessary
If you do not want to see possible messages about in use files, stop the tomcat6 service first
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.
Trying to run the Apache Installer with the current Service up-and-running and going into the same folder:
You will have to abort.. close Tomcat6w.exe by right-clicking on the app in the tray and choosing exit
Scenario 2, let’s stop our monitors and stop the Apache Service:
OK.. Let’s uninstall The Application – Add/remove or Programs and Features..
Stop 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..
Awesome! Service installs and completes..
Let’s check a couple of other things:
Since I have done this before.. Copy sqljdbc4.jar from /tomcat6-old/lib to the /tomcat6/lib folder..
ml to /tomcat6/conf/
Restart Apache Tomcat services and check connectivity again.
Wait for services to come back online.. Re-enable monitors.. We are done!!
After the systems comes back online, watch the Tomcat install for memory and CPU usage.