EN
Bash - how to check Tomcat server version?
2 points
In this short article, we are going to show how to check Tomcat server version under Linux.
The solution is quite simple: go to
bin/
directory in Tomcat server installation path and callversion.sh
script.
Quick solution (run the following command):
xxxxxxxxxx
1
/usr/share/tomcat*/bin/version.sh
Example paths:
xxxxxxxxxx
1
/usr/share/tomcat10/bin/version.sh
2
/usr/share/tomcat9/bin/version.sh
3
/usr/share/tomcat8/bin/version.sh
Note: the above paths should be working for Debian/Ubuntu family Linuxes when Tomcat server was installed with default packages manager - in other distributions or cases do the below Simple steps.
Simple steps:
- find Tomcat server installation directory using:
or call
xxxxxxxxxx
1find / -type d -name "tomcat*"
whereis tomcat9
replacing 9 with major version number (7, 8, 9, 10, etc.), - go to
bin/
directory using:xxxxxxxxxx
1cd /path/to/tomcat/bin
- run
version.sh
script using:xxxxxxxxxx
1./version.sh
- find the line started with
Server version:
.
1. Finding Tomcat server installation directory:
xxxxxxxxxx
1
root@debian-server:~# find / -type d -name "tomcat*"
Example output:
xxxxxxxxxx
1
/etc/tomcat8
2
/var/cache/tomcat8
3
/var/lib/tomcat8
4
/var/log/tomcat8
5
/usr/share/tomcat8-root
6
/usr/share/doc/tomcat8-common
7
/usr/share/doc/tomcat8
8
/usr/share/tomcat8
9
/sys/fs/cgroup/pids/system.slice/tomcat8.service
10
/sys/fs/cgroup/devices/system.slice/tomcat8.service
11
/sys/fs/cgroup/systemd/system.slice/tomcat8.service
2. Going to bin/
directory:
xxxxxxxxxx
1
root@debian-server:~# cd /usr/share/tomcat8/bin
3. Runing version.sh
script:
xxxxxxxxxx
1
root@debian-server:/usr/share/tomcat8/bin# ./version.sh
Example output:
xxxxxxxxxx
1
Using CATALINA_BASE: /usr/share/tomcat8
2
Using CATALINA_HOME: /usr/share/tomcat8
3
Using CATALINA_TMPDIR: /usr/share/tomcat8/temp
4
Using JRE_HOME: /usr
5
Using CLASSPATH: /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
6
Server version: Apache Tomcat/8.5.54 (Debian)
7
Server built: Apr 25 2020 15:01:31 UTC
8
Server number: 8.5.54.0
9
OS Name: Linux
10
OS Version: 4.9.0-11-amd64
11
Architecture: amd64
12
JVM Version: 1.8.0_252-8u252-b09-1~deb9u1-b09
13
JVM Vendor: Oracle Corporation
4. Finding the Server version:
xxxxxxxxxx
1
Apache Tomcat/8.5.54 (Debian)