/multiple-instances-tomcat

Install Multiple Instances of Apache Tomcat on Linux

Primary LanguageShellGNU General Public License v3.0GPL-3.0

Install Multiple Instances of Apache Tomcat 8 on Linux

A simple bash script to install 1 - 4 Apache Tomcat 8 instances.

The script searches for the latest version of Tomcat 8 and downloads it. A separate folder is created for each instance and the ports are changed in the server.xml file. There is also the option of automatically configuring Apache Tomcat instances as a service.

IMPORTANT:

  • Java must be installed!
  • Please remember to open the ports in the firewall to reach the server.

Run RunInstallation.sh

  1. Go to the folder where you want to install the apache tomcat instances. The script creates subfolders for each instance in this folder.
  2. Download script with
sudo wget https://raw.githubusercontent.com/roscha444/multiple-instances-tomcat/master/RunInstallation.sh
  1. Make script executable
sudo chmod +x RunInstallation.sh
  1. Run script with
sudo ./RunInstallation.sh

Ports of apache tomcats instances:

Standard ports of the script! You can change ports individually in the upper area of the script with a text editor.

Server 1: HTTP Port...........:8080
Server 1: HTTPS Port..........:8443
Server 1: Shutdown Port.......:8005
Server 1: AJP Connector Port..:8009

Server 2: Change HTTP Connector Port...:8080 to :8081
Server 2: Change HTTPS Connector Port..:8443 to :8444
Server 2: Change Shutdown Port.........:8005 to :8006
Server 2: Change AJP Connector Port....:8009 to :8010

Server 3: Change HTTP Connector Port...:8080 to :8082
Server 3: Change HTTPS Connector Port..:8443 to :8445
Server 3: Change Shutdown Port.........:8005 to :8007
Server 3: Change AJP Connector Port....:8009 to :8011

Server 4: Change HTTP Connector Port...:8080 to :8083
Server 4: Change HTTPS Connector Port..:8443 to :8446
Server 4: Change Shutdown Port.........:8005 to :8008
Server 4: Change AJP Connector Port....:8009 to :8012

Configured services:

service tomcat-1 start / stop / status / restart
service tomcat-2 start / stop / status / restart
service tomcat-3 start / stop / status / restart
service tomcat-4 start / stop / status / restart

In this build Version 1.0 :

  • The script creates a separate folder for each apache tomcat instance and changes the ports in the server.xml. After the installation all instances are started.
  • The possibility to choose whether the apache tomcat instances should be automatically configured as a service.

Planned in next build:

  • Select apache tomcat version to install
  • Start and Stop all instances with one command