zoukankan      html  css  js  c++  java
  • centos7部署tomcat

    centos7部署tomcat:

    参考网址:https://www.cnblogs.com/joe2047/p/9588847.html

    tomcat上部署Jenkins:

    参考网址:https://blog.csdn.net/q13554515812/article/details/83211508

    写启动jenkins服务脚本,命令如下

    vim /etc/init.d/jenkins 

    脚本内容如下:

    #!/bin/sh  
    #  
    # Startup script for the Jenkins Continuous Integration server  
    # (via Jakarta Tomcat Java Servlets and JSP server)  
    #  
    # chkconfig: - 85 15  
    # description: Jakarta Tomcat Java Servlets and JSP server  
    # processname: tomcat  
    # pidfile: /var/run/tomcat.pid  
       
    # Set Tomcat environment.  
    JENKINS_USER=root  
    LOCKFILE=/var/lock/jenkins  
    export PATH=/usr/local/bin:$PATH  
    export HOME=/jenkins  
    export JAVA_HOME=/usr/lib/jvm/java-1.8.0
    export JENKINS_BASEDIR=/jenkins  
    export TOMCAT_HOME=/usr/local/tomcat  
    export CATALINA_PID=$JENKINS_BASEDIR/jenkins-tomcat.pid  
    export CATALINA_OPTS="-DJENKINS_HOME=$JENKINS_BASEDIR/jenkins-home -Xmx512m -Djava.awt.headless=true"  
       
    [ -f $TOMCAT_HOME/bin/catalina.sh ] || exit 0  
       
    export PATH=$PATH:/usr/bin:/usr/local/bin  
       
    # See how we were called.  
    case "$1" in  
      start)  
            # Start daemon.  
            echo -n "Starting Tomcat: "  
            su -p -s /bin/sh $JENKINS_USER -c "$TOMCAT_HOME/bin/catalina.sh start"  
            RETVAL=$?  
            echo  
            [ $RETVAL = 0 ] && touch $LOCKFILE  
            ;;  
      stop)  
            # Stop daemons.  
            echo -n "Shutting down Tomcat: "  
            su -p -s /bin/sh $JENKINS_USER -c "$TOMCAT_HOME/bin/catalina.sh stop"  
            RETVAL=$?  
            echo  
            [ $RETVAL = 0 ] && rm -f $LOCKFILE  
            ;;  
      restart)  
            $0 stop  
            $0 start  
            ;;  
      condrestart)  
           [ -e $LOCKFILE ] && $0 restart  
           ;;  
      status)  
            status tomcat  
            ;;  
      *)  
            echo "Usage: $0 {start|stop|restart|status}"  
            exit 1  
    esac  
       
    exit 0
  • 相关阅读:
    java 网络编程
    JAVA 中for-each循环使用方法
    JAVA 常用集合接口List、Set、Map总结
    android学习计划
    ExtJs
    jQuery easyui
    MVC
    简易servlet计算器
    使用servlet实现用户注册功能
    用JavaBean实现数据库的连接和关闭,在jsp页面输出数据库中student表中学生的信息
  • 原文地址:https://www.cnblogs.com/jingzaixin/p/11561507.html
Copyright © 2011-2022 走看看