Tomcat 配置自启动服务

Ari8629 9年前

来自: http://my.oschina.net/liuhuan0927/blog/606914


[root@tomcat ~]# vim /etc/init.d/tomcat  #!/bin/sh  # Tomcat init script for Linux.  #  # chkconfig: 2345 96 14  # description: The Apache Tomcat servlet/JSP container.  CATALINA_HOME=/usr/local/tomcat #注意你的脚本路径  export CATALINA_HOME  # export CATALINA_OPTS="-Xms128m -Xmx256m"  exec $CATALINA_HOME/bin/catalina.sh $*
[root@tomcat ~]# chmod +x /etc/init.d/tomcat  [root@tomcat ~]# chkconfig --add tomcat  [root@tomcat ~]# chkconfig tomcat --list  [root@tomcat ~]# 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  Using CLASSPATH:    /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar