Details of the steps to restart Tomcat under Linux
- 2020-05-30 21:44:18
- OfStack
This article mainly introduces the steps to restart Tomcat under Linux. Under Linux system, restart Tomcat using the command!
The specific steps are as follows:
First, go to the bin directory under Tomcat
cd /usr/local/tomcat/bin
Close the command using Tomcat
./shutdown.sh
See if Tomcat is turned off
ps -ef|grep java
If the following similar information is displayed, Tomcat is not closed
root 7010 1 0 Apr19 ? 00:30:13 /usr/local/java/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1024m -Xmx1024m -XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+DisableExplicitGC -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat/endorsed -classpath /usr/local/tomcat/bin/bootstrap.jar -Dcatalina.base=/usr/local/tomcat -Dcatalina.home=/usr/local/tomcat -Djava.io.tmpdir=/usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap start
* if you want to kill Tomcat directly, you can use the kill command to kill the Tomcat process directly
kill -9 7010
Then proceed to see if Tomcat is down
ps aux and ps-ef commands
ps aux displays the java process in BSD format
Shows that the project has: USER PID, % CPU, % MEM, VSZ, RSS, TTY, STAT, START, TIME, COMMAND
ps -ef displays the java process in a standard format
Shows that the project has: UID PID, PPID, C, STIME, TTY, TIME, CMD
ps -ef|grep java
If the following information appears, Tomcat is closed
root 7010 1 0 Apr19 ? 00:30:30 [java] <defunct>
Finally, start Tomcat
./startup.sh
Note: use root user to log in Linux system; Enter the Tomcat directory correctly; Start Tomcat after making sure that Tomcat is closed, otherwise the port will be occupied.
conclusion