[LINUX] Install tomcat 9 on Cent OS 8

Introduction

Install Tomcat 9 in the environment where CentOS-8.1.1911-x86_64 was installed by "minimum installation". JAVA must be installed in advance. Please refer to here for installing JAVA.

User created

useradd -s /sbin/nologin tomcat

download

curl -O http://ftp.yz.yamagata-u.ac.jp/pub/network/apache/tomcat/tomcat-9/v9.0.34/bin/apache-tomcat-9.0.34.tar.gz

Extract / move files

tar xvzf apache-tomcat-9.0.34.tar.gz -C /opt
ln -s /opt/apache-tomcat-9.0.34 /opt/apache-tomcat
chown -R tomcat. /opt/apache-tomcat-9.0.34

Pass through

echo "export CATALINA_HOME=/opt/apache-tomcat" > /etc/profile.d/tomcat.sh
source /etc/profile

Create a service definition file

vi /etc/systemd/system/tomcat.service

tomcat.service


[Unit]
Description=Apache Tomcat 9
After=syslog.target network.target

[Service]
User=tomcat
Group=tomcat
Type=oneshot
PIDFile=/opt/apache-tomcat/tomcat.pid
RemainAfterExit=yes

ExecStart=/opt/apache-tomcat/bin/startup.sh
ExecStop=/opt/apache-tomcat/bin/shutdown.sh
ExecReStart=/opt/apache-tomcat/bin/shutdown.sh;/opt/apache-tomcat/bin/startup.sh

[Install]
WantedBy=multi-user.target

Authorization

chmod 755 /etc/systemd/system/tomcat.service

Firewall settings

firewall-cmd --add-port=8080/tcp --zone=public --permanent
systemctl restart firewalld

Start-up

systemctl start tomcat

Reboot

systemctl restart tomcat

Stop

systemctl stop tomcat

Auto start setting

systemctl enable tomcat

Version confirmation

/opt/apache-tomcat/bin/version.sh
Using CATALINA_BASE:   /opt/apache-tomcat
Using CATALINA_HOME:   /opt/apache-tomcat
Using CATALINA_TMPDIR: /opt/apache-tomcat/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /opt/apache-tomcat/bin/bootstrap.jar:/opt/apache-tomcat/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.34
Server built:   Apr 3 2020 12:02:52 UTC
Server number:  9.0.34.0
OS Name:        Linux
OS Version:     4.18.0-147.8.1.el8_1.x86_64
Architecture:   amd64
JVM Version:    11.0.7+10
JVM Vendor:     AdoptOpenJDK

Operation check

http://hostname:8080/docs/ It is OK if you access to and the following page is displayed.

tomcat-docs.jpg

Summary

You have successfully installed it.

Recommended Posts

Install tomcat 9 on Cent OS 8
Install Adopt OpenJDK 11 on Cent OS 8
Install tomcat 5.5 on Amazon Linux.
Install Python 3.8 on Ubuntu 18.04 (OS standard)
Install Python 3.8 on Ubuntu 20.04 (OS standard)
Install Sphinx on Mac OS X
Install Scipy on Mac OS Sierra
Install mitmproxy on Mac OS X
Install Python 3.9 on Ubuntu 20.04 (OS standard?)
Install Python 2.7 on Ubuntu 20.04 (OS standard?)
Install pgmagick on Mac OS X 10.9
How to integrate Apache httpd 2.4 and Tomcat 9 on Cent OS 8
Install matplotlib on OS X El Capitan
Install 64-bit OS (bate) on Raspberry Pi
Install docker-compose on 64-bit Raspberry Pi OS
Install the latest version of Apache httpd 2.4 from source on Cent OS 8
Easy way to use Python 2.7 on Cent OS 6
Install mecab on Marvericks
Install TensorFlow on Ubuntu
Install python on WSL
Install pyenv on mac
Install pip on Mavericks
Install mongodb on termux
Install Scrapy on python3
Install docker on Fedora31
Install numba on CentOS 7.2
Install Ansible on Mac
Install Python on Mac
Install Python 3 on Mac
Install Plone (4.3.6) on MacOSX (10.10.3)
Install PySide2 on Ubuntu
Install Python3.4 on CentOS 6.6
Install gensim on Marvericks
Install JModelica on Ubuntu
Install Anaconda on Windows 10
Install numpy on Marvericks
Install python on windows
Install enebular-agent on Chromebook
Install pycuda on Windows10
Install mecab-python on CentOS
Install Python 2.7.3 on CentOS 5.4
Install aws-cli on MacPorts
Install pygraphviz on Windows 10
Install Docker on AWS
Install Python 3.3 on Ubuntu 12.04
Install Chainer 1.5.0 on Windows
Install Python 3.4 on Mac
Install Caffe on Mac
Install Theano on Ubuntu 12.04
Install pyenv on OSX
Install mecab on mac
Install awscli on centos7
Install angr on Ubuntu 18.04
Install Chainer on CentOS 6.7
Install mecab-python on Mac
Install pip / pip3 on Ubuntu
Install Python 3.6 on Docker
Install Apache Tomcat 9 on Ubuntu 19.10 Eoan Ermine Hello World
Build onboard RAID with T1310M3 and install Cent OS 7.7
Very easy to install SciPy on Mac OS X
How to install caffe on OS X with macports