How to install Tomcat-8.5.39 on centos7.6

How to install Tomcat-8.5.39 on centos7.6

Here is how to install Tomcat-8.5.39 on centos7.6. The details are as follows:

#Shut down the firewall systemctl stop firewalld.service
systemctl disable firewalld
setenforce 0
sed -i '/SELINUX=/ s/enforcing/disabled/' /etc/selinux/config

#linux Update the yum source to Alibaba Cloud source yum install wget vim -y
#mkdir -pv /etc/yum.repos.d/bak
#mv -if /etc/yum.repos.d/* /etc/yum.repos.d/bak
#a=`cat /etc/redhat-release |awk '{print $4}'|awk -F . '{print $1}'`
#if [ $a == 6 ];then
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
#else
# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#fi
#yum clean all
#yum makecache
#yum update

#Essential for installation yum install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel tar unzip zip autoconf libtool make -y

#Install JDK
yum remove -y java*.x86_64
yum -y remove java-1.7.0-openjdk* 
yum -y remove java-1.8.0-openjdk*
yum install java-1.8.0-openjdk* -y
java -version
javac -version

#Install Tomcat
tar -xzvf /opt/soft/apache-tomcat-8.5.39.tar.gz -C /usr/local/
mv -f /usr/local/apache-tomcat-8.5.39 /usr/local/tomcat8.5.39
chmod 777 /usr/local/tomcat8.5.39/bin/*.sh
cp /opt/soft/tomcat /etc/init.d/
chmod 755 /etc/init.d/tomcat
/etc/init.d/tomcat restart
chkconfig --add tomcat
chkconfig tomcat on

Tomcat start and stop script

#!/bin/bash
# description: Tomcat7 Start Stop Restart
# processname: tomcat7
# chkconfig: 234 20 80

CATALINA_HOME=/usr/local/tomcat8.5.39

case $1 in
  start)
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  stop)
    ps -e|grep java|awk '{print "kill -9 "$1}'|sh
    # sh $CATALINA_HOME/bin/shutdown.sh
    ;;
  restart)
    ps -e|grep java|awk '{print "kill -9 "$1}'|sh
    sleep 3
    # sh $CATALINA_HOME/bin/shutdown.sh
    sh $CATALINA_HOME/bin/startup.sh
    ;;
  *)
    echo 'please use : tomcat {start | stop | restart}'
  ;;
esac
exit 0

Summarize

The above is the method of installing Tomcat-8.5.39 on centos7.6 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • How to install and configure tomcat9 in Centos7 and set it to start automatically
  • Solve the problem of tomcat startup and local access in centos7
  • How to install Redis and set up auto-startup for tomcat in Alibaba Cloud Centos7
  • Installation and configuration tutorial of Tomcat8 under Centos7.3
  • Tomcat installation tutorial under Linux centos7 environment
  • Detailed explanation of CentOS7.0 installation and configuration of Tomcat-7
  • How to intercept the specified Tomcat log to the specified file in CentOS7 according to the time period

<<:  Analysis and solution of MySQL connection throwing Authentication Failed error

>>:  WeChat applet development practical skills: data transmission and storage

Recommend

VUE+Canvas implements the sample code of the desktop pinball brick-breaking game

Everyone has played the pinball and brick-breakin...

How to avoid duplication of data when inserting in MySql batch

Table of contents Preface 1. insert ignore into 2...

How to encapsulate axios in Vue

Table of contents 1. Installation 1. Introduction...

MySQL paging performance exploration

Several common paging methods: 1. Escalator metho...

MySQL simple example of sorting Chinese characters by pinyin

If the field storing the name uses the GBK charac...

Web page comments cause text overflow in IE

The experimental code is as follows: </head>...

Native JavaScript implementation of progress bar

The specific code for JavaScript to implement the...

How to export mysql table structure to excel

The requirements are as follows Export the table ...

Thinking about grid design of web pages

<br />Original address: http://andymao.com/a...

vue+tp5 realizes simple login function

This article example shares the specific code of ...

File sharing between Ubuntu and Windows under VMware

This article records the method of sharing files ...

Detailed steps for yum configuration of nginx reverse proxy

Part.0 Background The company's intranet serv...

Solution to the lack of my.ini file in MySQL 5.7

What is my.ini? my.ini is the configuration file ...

JS implements city list effect based on VUE component

This article example shares the specific code for...