Understanding how different Tomcat Instances can live with different Java versions.

I am using Fedora 25 for this application. Since I like tinkering with the different options a server can have, I began reading up on how the Java version I have installed in my system relates to the Tomcat version installed. Of course, Tomcat IS written in java and it uses I like the folder structure of Tomcat on Linux because I can use the tree command to look at all the files.

But I cannot understand how each folder and file relates to the Tomcat server. Using Django seems to have the same idea with less files. Also, it uses python in the backend to modify settings and different virtual environments created by the user. The first step I took in installing tomcat on my Fedora 25 system was using this command.

dnf -y install tomcat

I then checked the java version I have with the command:

Java -version
[root@host-40 tomcat]# java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

I know that I can install a different instances of Tomcat per the book: I then checked what Tomcat version I had

[root@host-40 tomcat]# tomcat version
Server version: Apache Tomcat/8.0.47
Server built:   Oct 25 2017 15:10:50 UTC
Server number:
OS Name:        Linux
OS Version:     4.13.16-100.fc25.x86_64
Architecture:   amd64
JVM Version:    1.8.0_151-b12
JVM Vendor:     Oracle Corporation

In my system the webapps folder is /usr/share/tomcat.

Using the tree command I verified the folder structure like so:

[root@host-40 tomcat]# tree
├── bin
│   ├── bootstrap.jar
│   ├── catalina-tasks.xml
│   └── tomcat-juli.jar
├── conf -> /etc/tomcat
├── lib -> /usr/share/java/tomcat
├── logs -> /var/log/tomcat
├── temp -> /var/cache/tomcat/temp
├── webapps -> /var/lib/tomcat/webapps
└── work -> /var/cache/tomcat/work

7 directories, 3 files

I know it comes with the webapps folder and basic examples but I just can’t get around understanding how different instances can live together or what would be a good resource to understand the different folders and files that are important to Tomcat and Java.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @tony54143fcdd2516652c9e275,

There are a couple of suggestions that I have:

  • If you want to have multiple versions, then you could download the source files manually and run them rather than using the dnf command to install the 1 available version from the repositories

  • You could use Docker and run your applications inside containers so that you have an isolated environment for each application and you have all of the dependencies and versions packaged in a nice container

Hope that this helps! Regards, Bobby