What is Tomcat?
Tomcat is a small program that runs websites written in Java. Apache, the usual web server, cannot run Java pages by itself. Tomcat does that job next to it.
Root is the main administrator account on a server. It can change everything. Be careful when you use it.
When should you restart Tomcat?
- Your Java site shows an error page or does not load.
- You changed a Tomcat setting and it must be read again.
- You installed a new Java application and it does not appear.
Steps
- Log in to your server over SSH as root. SSH is a safe way to type commands on a remote server. Your server details are in your welcome email.
- Run this command to restart Tomcat.
/scripts/restartsrv_tomcat
This cPanel script stops Tomcat and starts it again.
- Check that Tomcat is running again with this command.
/scripts/restartsrv_tomcat --status
It prints a short message that says whether the service is up.
- Open your Java website in a browser and see if it loads.
Restart from WHM
WHM is the control panel for the server owner. You can also restart services there.
- Log in to WHM as root.
- Use the search box at the top left and type Restart.
- Open Restart Services.
- Find Tomcat in the list. If you do not see it, Tomcat is not installed through cPanel on your server.
- Click the restart link next to it and confirm.
If it still does not work
Look at the Tomcat log files. They are often in the logs folder inside the Tomcat folder. The last lines usually name the problem. If you cannot fix it, open a support ticket and paste the log lines.
Quick recap
- Tomcat runs Java websites on your server.
- You need root access to restart it.
- Run
/scripts/restartsrv_tomcatover SSH, or use Restart Services in WHM. - Restarting causes a short pause, so pick a quiet time.
- Ask support if the command or the Tomcat entry is missing.