install_tomcat_vhost_v1

浏览:141
jackios 2020-07-18 16:43

#!/bin/bash

#2020年7月18日14:23:10

# by jackios

########

echo " install jdk"

cd /usr/local/src

if [ -f /usr/local/jdk1.8.0_131.tar.gz ] ;then

tar xf jdk1.8.0_131.tar.gz 

mkdir -p /usr/local/java

if [ $? -eq 0 ] ; then

mv jdk1.8.0_131  /usr/local/java

fi

fi

echo "config java path‘"

cat >>/etc/profile<<-EOF

export JAVA_HOME=/usr/local/java/jdk1.8.0_131

export JRE_HOME=/usr/local/java/jdk1.8.0_131/jre

export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib:$CLASS_PATH

export PATH=$JAVS_HOME/bin:$JRE_HOME/bin:$PATH

EOF

source /etc/profile

java -version

echo " install tomcat"

if [ ! -d /usr/local/tomcat8080 ] ; then

if [ apache-tomcat-9.0.37.tar.gz ] ; then

tar xf apache-tomcat-9.0.37.tar.gz

fi

mv apache-tomcat-9.0.37 /usr/local/tomcat8080 

/usr/local/tomcat8080/bin/startup.sh 

fi

if [ -d /usr/local/tomcat8080 ] ;then

 

for i in `seq 1 9`

do 

if [ -f apache-tomcat-9.0.37.tar.gz ] ; then

tar xf apache-tomcat-9.0.37.tar.gz

fi


mv apache-tomcat-9.0.37 /usr/local/tomcat808$i

sed -i 's/Server port="8005"/Server port="708'$i'"/' /usr/local/tomcat808$i/conf/server.xml 

sed -i 's/Connector port="8080"/Connector port="808'$i'"/' /usr/local/tomcat808$i/conf/server.xml 

sed -i 's/Connector port="8009"/Connector port="908'$i'"/' /usr/local/tomcat808$i/conf/server.xml

/usr/local/tomcat808$i/bin/startup.sh

done

fi



如果觉得我的文章对你有用,请随意赞赏

待完善
不要去追一匹马,用追马的时间种草,待到春暖花开时,就会有一批骏马任你挑选;不要去刻意巴结一个人,用暂时没有朋友的时间,去提升自己的能力,待到时机成熟时,就会有一批的朋友与你行。用人情做出来的朋友只是暂时的,用人格吸引来的朋友才是长久的。所以种下梧桐树,引得凤凰来。你若盛开,蝴蝶自来,你若精彩,天自安排
微信扫码登录测试

Powered by Jackios V1.0 Copyright © 2019-2020 liuql 版权所有 备案号: 鲁ICP19026293号