Step-by-step guide to update Apache Tomcat.
This document provides a comprehensive guide for manually updating Apache Tomcat on a Windows system, specifically addressing the configuration of Tomcat 9 Core for Innoslate-related web applications. It is important to note that testing has only been performed up to Apache Tomcat 9; subsequent versions have not yet been validated for compatibility with Innoslate.
To proceed, please follow the detailed steps outlined below for downloading, configuring, and updating Tomcat manually.
Prerequisites
- Administrative access to the Windows machine Innoslate is installed on.
- A compatible Java Development Kit (JDK) installed (e.g., JDK 8 or 11, depending on Tomcat 9 requirements).
- Backup of your existing Tomcat installation and web applications (recommended).
Step-by-Step Guide
1. Download Tomcat
Visit the official Apache Tomcat website and download Tomcat 9 Core. As an example, we’ll use apache-tomcat-9.0.100-windows-x64.
URL: [Apache Tomcat Downloads](https://tomcat.apache.org/download-90.cgi)
Extract the downloaded ZIP file to the location of your choice (e.g., `C:\Tomcat`).
2. Rename the Tomcat Folder
Rename the extracted folder (e.g., `apache-tomcat-9.0.100`) to simply `apache-tomcat`.
Example: `C:\Tomcat\apache-tomcat`.
3. Configure the `webapps` Folder
Navigate to the `webapps` folder inside your Tomcat directory (e.g., `C:\Tomcat\apache-tomcat\webapps`).
Delete all existing contents in the `webapps` folder to start fresh.
Add the following:
`innoslate4` folder (your Innoslate web application).
`socket` folder (if required for your setup).
`integrations` folder (optional, depending on your configuration).
`setup.war` file (the Innoslate setup WAR file).These components will be deployed automatically when Tomcat starts.
4. Update the `service.bat` File
Navigate to the `bin` folder (e.g., `C:\Tomcat\apache-tomcat\bin`).
Open `service.bat` in a text editor with administrative privileges.
Modify the following lines to adjust memory settings and service configuration:
Lines 213 and 214: Set the initial (`JvmMs`) and maximum (`JvmMx`) JVM memory allocation to 4098 MB (adjust as needed for your system).
```batch
if "%JvmMs%" == "" set JvmMs=4098
if "%JvmMx%" == "" set JvmMx=4098
```
- Line 226: Ensure the `--DisplayName` parameter reflects your service name. For example:
```batch
--DisplayName "%SERVICE_NAME%" ^
```
Save and close the file.
5. Update the `server.xml` File
Navigate to the `conf` folder (e.g., `C:\Tomcat\apache-tomcat\conf`).
Open `server.xml` in a text editor.
Make the following changes:
Line 71 (Connector Configuration): Add the `maxSwallowSize="-1"` attribute to the `<Connector>` element to disable the swallow size limit (useful for larger uploads).
```xml
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
maxSwallowSize="-1" />
```
Before `</Host>` (at the bottom): Add a `<Context>` element to map the `innoslate4` application as the root context.
```xml
<Context path="" docBase="innoslate4" debug="0" reloadable="true"></Context>
```
Save and close the file.
6. (Optional) Configure SSL
If you’re using SSL for secure connections, additional configuration is required in `server.xml` (e.g., enabling the HTTPS connector and specifying keystore settings). Refer to the official Tomcat SSL documentation or your organization’s SSL setup guide for details:
7. Update the Windows Service
- Navigate to the `innoslate4\utilities` folder within your Tomcat installation or Innoslate directory.
- Run the `update_innoslate_service.cmd` script as an administrator. This script updates the Windows service to use the new Tomcat installation with Innoslate.
- Verify the service is updated by checking the Windows Services panel (`services.msc`) and ensuring the service name and path reflect your new Tomcat configuration.
Verification
- Start the Tomcat service (e.g., via `services.msc` or the `startup.bat` file in the `bin` folder for testing).
- Open a browser and navigate to `http://localhost:8080` (or your configured port) to confirm Tomcat is running.
- Check that the `innoslate4` application is accessible at the root path (`http://localhost:8080/`).
Troubleshooting Tips
- Service Fails to Start: Check the `logs` folder (e.g., `C:\Tomcat\apache-tomcat\logs`) for error messages. Common issues include incorrect JDK paths or insufficient memory.
- Application Not Loading: Ensure the `innoslate4` folder and `setup.war` are correctly placed in `webapps` and that `server.xml` is properly configured.
- Port Conflicts: If port 8080 is in use, modify the `<Connector>` port in `server.xml` to an available port.