编写一个有关于tomcat启动服务的脚本,方便开机自动启动。
. /etc/profile.d/tomcat.sh # 编写服务脚本 vim /etc/rc.d/init.d/tomcat #!/bin/sh # Tomcat init script for Linux. # # chkconfig: 2345 96 14 # description: The Apache Tomcat servlet/JSP container. # JAVA_OPTS=‘-Xms128m -Xmx512m‘ JAVA_HOME=/usr/java/jdk CATALINA_HOME=/usr/local/tomcat export JAVA_HOME CATALINA_HOME case $1 in start) exec $CATALINA_HOME/bin/catalina.sh start ;; stop) exec $CATALINA_HOME/bin/catalina.sh stop;; restart) $CATALINA_HOME/bin/catalina.sh stop sleep 2 exec $CATALINA_HOME/bin/catalina.sh start ;; configtest) exec $CATALINA_HOME/bin/catalina.sh configtest ;; *) exec $CATALINA_HOME/bin/catalina.sh * ;; esac ========== chmod +x /etc/init.d/tomcat
tomcat 启动服务脚本
时间: 2024-11-07 11:47:10