Tomcat Command and Operation Manual¶
Viewing Tomcat Version Information¶
Use the version.sh (Linux/Mac) or version.bat (Windows) script to view the Tomcat version information.
Starting Tomcat¶
Use the startup.sh (Linux/Mac) or startup.bat (Windows) script to start the Tomcat server.
Stopping Tomcat¶
Use the shutdown.sh (Linux/Mac) or shutdown.bat (Windows) script to stop the Tomcat server.
Restarting Tomcat¶
Stop and then start the Tomcat service.
Setting Environment Variables¶
You can set the CATALINA_HOME and JAVA_HOME environment variables to specify the installation paths for Tomcat and Java.
# Set CATALINA_HOME
export CATALINA_HOME=/path/to/tomcat
# Set JAVA_HOME
export JAVA_HOME=/path/to/java
Deploying Applications¶
Copy the WAR file to the webapps/ directory, and Tomcat will automatically deploy the application.
Configuration Files¶
The main configuration files are located in the conf/ directory, including server.xml, web.xml, and context.xml.
Log Files¶
Log files are usually located in the logs/ directory, such as catalina.out and localhost.log.
Debug Mode¶
Start Tomcat in debug mode for development and troubleshooting.
Cleaning Work Directory¶
Cleaning the work/ directory can free up disk space and resolve some temporary file issues.