How to restart Tomcat regularly on Linux system

  
                

When doing a Java website project, if you encounter a problem that the Tomcat server dies every few days, then temporarily restart the Tomcat to solve the problem temporarily. The following small series will bring you the scheduled restart of the Tomcat service in the Linux operating system. The way, let's learn together.

The Linux operating system periodically restarts the Tomcat service as follows:

1. Write tomcat_shutdown.sh:

#! /bin/sh

export JAVA_HOME=/home/oracle/jdk1.7.0_67/

export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar< Br>

export PATH=$JAVA_HOME/bin:$PATH

echo “========begin stop the tomcat========”

& lsquo; /home/oracle/apache-tomcat-7.0.29/bin/shutdown.sh’

2, write tomcat_startup.sh:

#! /bin/sh

export JAVA_HOME=/home/oracle/jdk1.7.0_67/

export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar< Br>

export PATH=$JAVA_HOME/bin:$PATH

echo “========begin start the tomcat========”

& lsquo; /home/oracle/apache-tomcat-7.0.29/bin/startup.sh’

3, the linux system terminal, enter the command & ldquo; crontab -e & rdquo;: < Br> Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved