Reputation: 485
Need to verify tomcat's version on the server while running ansible playbooks. The only way I know to do that is:
[root@server ~]# cd /usr/share/tomcat8/bin/
[root@server bin]# ./version.sh
Using CATALINA_BASE: /usr/share/tomcat8
Using CATALINA_HOME: /usr/share/tomcat8
Using CATALINA_TMPDIR: /usr/share/tomcat8/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.30
Server built: Dec 1 2015 22:30:46 UTC
Server number: 8.0.30.0
OS Name: Linux
OS Version: 2.6.32-504.1.3.el6.x86_64
Architecture: amd64
JVM Version: 1.8.0_66-b17
JVM Vendor: Oracle Corporation
Is there any other way? This one isn't the nicest one since even the directory of this version.sh script changes depending on tomcat version and there is a lot of parsing to do.
Upvotes: 0
Views: 2546
Reputation: 3760
there are several ways to do this you can find them here
- open http://localhost:8080/ in your web browser and version should be visible there.
- execute the version.sh script in your tomcat/bin directory.
- you can check it in release notes.
- you can also check the version through
java -cp catalina.jar org.apache.catalina.util.ServerInfo
source: how to find out running tomcat version
Upvotes: 1
Reputation: 44854
./version.sh
calls
./catalina.sh version
which calls
java -classpath "$CATALINA_HOME/lib/catalina.jar" org.apache.catalina.util.ServerInfo
Upvotes: 0