Viewing Tomcat Processes in Linux

1. View Tomcat process information

ps -ef | grep tomcat

Explanation: ps -ef lists detailed information about all processes, and grep ‘[c]atalina’ filters the lines containing ‘catalina’ (cleverly excluding the grep process itself). The output includes: process user, PID, startup command, and other key information.

2. Restart Tomcat

# Navigate to Tomcat’s bin directory
cd /path/to/tomcat/bin/
# Execute the restart script
./shutdown.sh && ./startup.sh
# Or use the catalina.sh script
./catalina.sh stop && ./catalina.sh start

3. Force restart

# Find Tomcat process ID
ps -ef | grep ‘[c]atalina’
# Kill the process (assuming PID is 12345)
kill -9 12345
# Restart
/path/to/tomcat/bin/startup.sh

Leave a Comment