Shell installation Tomcat (three)

Source: Internet
Author: User

#!/bin/bash#bu lctomcatdir=/home/tomcattomcattar= $TOMCATDIR/apache-tomcat-7.0.65.tar.gzjavadir=/usr/ javajdkdir= $JAVADIR/jdk1.8.0_65jdktar= $JDKDIR/jdk-8u65-linux-x64.tar.gz### #8080 # # # # #T8080DIR = $TOMCATDIR/ tomcat-reststart8080= $T 8080dir/bin/startup.sh### #8081 # # # #T8081DIR = $TOMCATDIR/tomcat-wapconf8081= $T 8081dir/conf /server.xmlcata8081= $T 8081dir/bin/catalina.shstart8081= $T 8081dir/bin/startup.sh### #8082 # # # # #T8082DIR = $TOMCATDIR /tomcat-activityconf8082= $T 8082dir/conf/server.xmlcata8082= $T 8082dir/bin/catalina.shstart8082= $T 8082dir/bin/ startup.shpanduan  () {  if [ $? -ne 0 ]   then     echo ====$1 not ok====  fi}checkdir () {  [ ! -d   $JAVADIR  ] && mkdir -p  $JAVADIR}checktar () {  if [ - z  $JDKTAR  ]  then    echo  "===>pls download  ' Jdktar '  at w8 d<=== "     exit  fi  if [ -z  $TOMCATTAR  ]   then    echo  "===>pls download  ' Tomcattar '  AT  ' w8 d ' <=== '      exit      fi }installtom () {   cd  $JAVADIR   tar xf  $JDKTAR   cd  $TOMCATDIR   tar  xf  $TOMCATTAR   /bin/mv  $TOMCATDIR/apache-tomcat  $T 8080dir  /bin/cp -a   $T 8080dir  $T 8081dir  /bin/cp -a  $T 8080dir  $T 8082dir  panduan  install}profile () {cat >>/etc/profile<<aa########===>tomcat<===####### #export  java_home= $JDKDIRexport  classpath=.:\ $JAVA _home/lib/dt.jar:\ $JAVA _home/lib/tools.jarexport path= $JAVA _home/bin:\ $PATHexport  catalina_base = $T 8080direxport catalina_home= $T 8080direxport tomcat_home= $T 8080direxport&nbsP catalina_2_base= $T 8081direxport catalina_2_home= $T 8081direxport tomcat_2_home= $T 8081direxport  catalina_3_base= $T 8082direxport catalina_3_home= $T 8082direxport tomcat_3_home= $T 8082dir############# ################ #AApanduan  profilesource /etc/profile}serverxml () {#vi  /home/tomcat/tomcat-rest/ conf/server.xml### #8081 ####  sed -i  ' 22s#8005#8006#g '   $CONF 8081  sed - i  ' 71s#8080#8081#g '   $CONF 8081  sed -i  ' 93s#8009#8010#g '   $CONF 8081### #8082 # # ##  sed -i  ' 22s#8005#8007#g '   $CONF 8082  sed -i  ' 71s#8080#8082#g '   $CONF 8082  sed -i  ' 93s#8009#8011#g '   $CONF 8082}catash () {#vi  /home/tomcat/ tomcat-rest/bin/catalina.sh### #8081 ####  sed -i  ' 2 iexport catalina_base=$ Catalina_2_base '   $CATA 8081  sed -i  ' 2 iexport catalina_home= $CATALINA _2_ HOME '   $CATA 8081## # #8082 ####  sed -i  ' 2 iexport catalina_base= $CATALINA _3_base '   $CATA 8082   sed -i  ' 2 iexport catalina_home= $CATALINA _3_home '   $CATA 8082}startall () {    $START 8080  panduan start8080   $START 8081  panduan  start8081   $START 8082  panduan start8082}main  () {  checkdir   CHECKTAR  INSTALLTOM  PROFILE  SERVERXML  CATASH   Startall}main


Shell installation Tomcat (three)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.