tomcat安装脚本部署

rz 先上传软件包
jdk-8u181-linux-x64.tar.gz
apache-tomcat-8.5.59.tar.gz

vim tomcat.sh

setenforce 0
systemctl stop firewalld
tar xf jdk-8u181-linux-x64.tar.gz -C /usr/local/
cd /usr/local/
mv jdk1.8.0_181 java
echo "export JAVA_HOME=/usr/local/java" >>/etc/profile
echo "export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH" >>/etc/profile
echo "export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar" >>/etc/profile
source /etc/profile
java -version
cd
#安装Tomcat
tar -xf apache-tomcat-8.5.59.tar.gz -C /usr/local/
mv /usr/local/{apache-tomcat-8.5.59,tomcat}
tomcatpath='export TOMCAT_HOME=/usr/local/tomcat/'
echo $tomcatpath > /etc/profile.d/tomcat.sh
source /etc/profile.d/tomcat.sh
/usr/local/tomcat/bin/version.sh
/usr/local/tomcat/bin/startup.sh
#/usr/local/tomcat/bin/shutdown.sh
ss -natl |grep java

你可能感兴趣的:(tomcat安装脚本部署)