centos7安装tomcat

centos7安装tomcat,第1张

centos7安装tomcat
#!/bin/bash
yum -y install wget vim curl net-tools
java -version >> /dev/null
if [ $? -eq 0];then
echo "JDK已经安装" > /dev/null
else
mkdir /opt/java
cd /opt
wget https://yw-du.oss-accelerate.aliyuncs.com/jdk-8u161-linux-x64.tar.gz
tar xf jdk-8u161-linux-x64.tar.gz -C /opt/java
sed -i '$aJAVA_HOME=/opt/java/jdk1.8.0_161' /etc/profile
sed -i '$aJRE_HOME=/opt/java/jdk1.8.0_161/jre' /etc/profile
sed -i '$aCLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib' /etc/profile
sed -i '$aPATH=$JAVA_HOME/bin:$PATH' /etc/profile
sed -i '$aexport PATH JAVA_HOME CLASSPATH' /etc/profile
sed -i '$aCATALINA_HOME=/opt/tomcat' /etc/profile
source /etc/profile
fi
source /etc/profile
cd /opt
wget https://downloads.apache.org/tomcat/tomcat-8/v8.5.63/bin/apache-tomcat-8.5.63.tar.gz
tar -zxvf apache-tomcat-8.5.63.tar.gz
mv apache-tomcat-8.5.63 tomcat
bash /opt/tomcat/bin/startup.sh
netstat -antulp | grep 8080

 

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5575930.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-14
下一篇 2022-12-14

发表评论

登录后才能评论

评论列表(0条)

保存