美文网首页Linux运维
CentOS 6.9 Jdk&Tomcat自动编译安装shell

CentOS 6.9 Jdk&Tomcat自动编译安装shell

作者: 仞渣 | 来源:发表于2017-08-09 13:18 被阅读0次

    操作系统:CentOS 6.9 x64 mini

    JDK : jdk1.8.0_144

    Tomcat : tomcat 7.0.79

    #!/bin/sh

    # Auther: Mr.G  Mail:cmaoge@126.com
    # QQ:825312600
    # Jdk & Tomcat  Install For CentOS

    tar zxvf jdk-8u144-linux-x64.tar.gz
    mkdir /www/server/java
    mv jdk1.8.0_144/ /www/server/java/
    cat >>/etc/profile<<"eof"
    JAVA_HOME=/www/server/java/jdk1.8.0_144
    export PATH="$PATH:$JAVA_HOME/bin"
    export CLASSPATH=".:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar"
    eof
    source /etc/profile

    #解压tomcat 并移动到指定目录
    # Tomcat 7.0.79
    tar zxvf apache-tomcat-7.0.79.tar.gz
    mv apache-tomcat-7.0.79 /www/server/tomcat7
    sed -i "N;4i\# description:Tomcat service" /www/server/tomcat7/bin/catalina.sh
    sed -i "N;4i\#chkconfig: 2345 10 90" /www/server/tomcat7/bin/catalina.sh
    sed -i "N;22i\JAVA_HOME=/www/server/java/jdk1.8.0_144" /www/server/tomcat7/bin/catalina.sh
    sed -i "N;22i\CATALINA_HOME=/www/server/tomcat7" /www/server/tomcat7/bin/catalina.sh
    ln -sf /www/server/tomcat7/bin/catalina.sh /etc/init.d/tomcat7
    chmod 755 /etc/init.d/tomcat7
    chkconfig --add tomcat7
    chkconfig tomcat7 on
    service tomcat7 status
    echo "/www/server/tomcat7/bin/startup.sh" >> /etc/rc.local

    相关文章

      网友评论

        本文标题:CentOS 6.9 Jdk&Tomcat自动编译安装shell

        本文链接:https://www.haomeiwen.com/subject/ujnfrxtx.html