配置tomcat为系统服务

# vi /etc/init.d/tomcat 
    #!/bin/sh
    # Tomcat init script for Linux.
    #
    # chkconfig: 2345 96 14
    # description: The Apache Tomcat servlet/JSP container.
    JAVA_HOME=/usr/java/latest
    CATALINA_HOME=/usr/local/tomcat
    export JAVA_HOME CATALINA_HOME
    exec $CATALINA_HOME/bin/catalina.sh $*

# service tomcat start
    Using CATALINA_BASE:   /usr/local/tomcat
    Using CATALINA_HOME:   /usr/local/tomcat
    Using CATALINA_TMPDIR: /usr/local/tomcat/temp
    Using JRE_HOME:        /usr/java/latest
    Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
    Tomcat started.

# service tomcat stop
    Using CATALINA_BASE:   /usr/local/tomcat
    Using CATALINA_HOME:   /usr/local/tomcat
    Using CATALINA_TMPDIR: /usr/local/tomcat/temp
    Using JRE_HOME:        /usr/java/latest
    Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar

# chkconfig --add tomcat
# chkconfig tomcat on
posted on 2018-01-26 19:28  呆萌小码  阅读(238)  评论(0编辑  收藏  举报