참조) https://www.linuxsysadmins.com/install-apache-tomcat-8-on-centos7/
참조) https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-centos-7
1) java 설치
$ java -version
$ sudo yum install java-1.8.0-openjdk
$ sudo yum install java-1.8.0-openjdk-devel
$ ls /usr/lib/jvm
$ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64
$ sudo sh -c "echo export JAVA_HOME==/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64 >> /etc/environment"
$ export JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/jre
$ export PATH=$PATH:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/bin:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/jre/bin
2) tomcat 설치
$ cd /opt
참고) https://downloads.apache.org/tomcat/tomcat-8 에 방문해서 최근 버전 확인할것
$wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.54/bin/apache-tomcat-8.5.54.tar.gz
$ sudo tar xzf apache-tomcat-8.5.54.tar.gz
$ sudo mv apache-tomcat-8.5.54 /usr/share/tomcat8
$ ls /usr/share/tomcat8
$ ls /usr/share/tomcat8/bin
$ cd /usr/share/tomcat8/bin/
$ ./startup.sh
$ /usr/share/tomcat8/bin/startup.sh
3) 방화벽 해제
firewall-cmd --permanent --zone=public --remove-port=8080/tcp
firewall-cmd --get-zones
firewall-cmd --reload
4) http://192.168.10.10:8080/sample 웹 접속을 위한 WAR 배포
/usr/share/tomcat8> cp webapps/docs/appdev/sample/sample.war webapps/
bin> shutdown.sh
bin> startup.sh