RaspberryPi に Tomcat をインストールする方法です。
sudo apt install tomcat9
インストールが完了すると既に、Tomcat が動いています。
$ sudo systemctl status tomcat9
● tomcat9.service - Apache Tomcat 9 Web Application Server
Loaded: loaded (/lib/systemd/system/tomcat9.service; enabled; vendor preset:
Active: active (running) since Thu 2020-06-25 18:32:44 JST; 3min 30s ago
Docs: https://tomcat.apache.org/tomcat-9.0-doc/index.html
Main PID: 2799 (java)
Tasks: 35 (limit: 4915)
Memory: 78.7M
CGroup: /system.slice/tomcat9.service
└─2799 /usr/lib/jvm/default-java/bin/java -Djava.util.logging.config.
/var/lib/tomcat9/webapps/ROOT/index.html を編集すれば、表示が変わります。
バージョンの確認方法
$ /usr/share/tomcat9/bin/version.sh
Using CATALINA_BASE: /usr/share/tomcat9
Using CATALINA_HOME: /usr/share/tomcat9
Using CATALINA_TMPDIR: /usr/share/tomcat9/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat9/bin/bootstrap.jar:/usr/share/tomcat9/bin/tomcat-juli.jar
NOTE: Picked up JDK_JAVA_OPTIONS: --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
Server version: Apache Tomcat/9.0.31 (Debian)
Server built: Apr 25 2020 12:24:56 UTC
Server number: 9.0.31.0
OS Name: Linux
OS Version: 4.19.118-v7l+
Architecture: arm
JVM Version: 11.0.7+10-post-Raspbian-3deb10u1
JVM Vendor: Raspbian