您好,登錄后才能下訂單哦!
下面給大家介紹centos7.6 安裝Tomcat-8.5.39的方法,具體內容如下所示:
#關閉防火墻 systemctl stop firewalld.service systemctl disable firewalld setenforce 0 sed -i '/SELINUX=/ s/enforcing/disabled/' /etc/selinux/config #linux 更新yum源 改成阿里云源 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 #裝機必備 yum install gcc gcc-c++ automake pcre pcre-devel zlib zlib-devel openssl openssl-devel tar unzip zip autoconf libtool make -y #安裝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 #安裝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啟停腳本
#!/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
總結
以上所述是小編給大家介紹的centos7.6 安裝Tomcat-8.5.39的方法,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!
如果你覺得本文對你有幫助,歡迎轉載,煩請注明出處,謝謝!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。