Centos安装Tomcat

Posted heqiuyong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos安装Tomcat相关的知识,希望对你有一定的参考价值。

#下载tomcat压缩包到/usr/local/tomcat/,并解压到当前目录
mkdir -p /usr/local/tomcat
cd /usr/local/tomcat
wget http://mirrors.hust.edu.cn/apache/tomcat/tomcat-9/v9.0.12/bin/apache-tomcat-9.0.12.tar.gz
tar -zxvf apache-tomcat-9.0.12.tar.gz

 

#编辑startup.sh
cd /usr/local/tomcat/apache-tomcat-9.0.12/bin
mv startup.sh startup.sh.bak
vi startup.sh
## FOR TOMCAT ##
export JAVA_HOME=/usr/local/java/jdk-9.0.4/
export CLASSPATH=.:${JAVA_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
export CATALINA_HOME=/usr/local/tomcat/apache-tomcat-9.0.12
/usr/local/tomcat/apache-tomcat-9.0.12/bin/catalina.sh start

#给startup.sh执行权限
chmod +x startup.sh

#开机自动启动startup.sh
vi /etc/rc.d/rc.local
## TOMCAT STARTUP ##
/usr/local/tomcat/apache-tomcat-9.0.12/bin/startup.sh

#放通相关的业务端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload

 




















以上是关于Centos安装Tomcat的主要内容,如果未能解决你的问题,请参考以下文章

Linux Centos7部署环境安装-CentOS

Linux下定时重启tomcatCentOS7.5

Linux下定时重启tomcatCentOS7.5

centos7怎么安装 centos7安装步骤

centos7安装教程?

centos7怎么安装 centos7安装步骤