Home >Java >javaTutorial >How to start tomcat in linux
Startup steps: 1. Enter the Tomcat directory; 2. Execute the startup script; 3. Wait for Tomcat to start; 4. Check whether Tomcat starts; 5. Visit the Tomcat management page. Detailed introduction: 1. Enter the Tomcat directory: use the terminal to enter the Tomcat installation directory; 2. Execute the startup script: In the Tomcat bin directory, there is a script file named catalina.sh (or catalina.bat on Windows). Used to start Tomcat and so on.
Operating system for this tutorial: Windows 10 system, Dell G3 computer.
Starting Tomcat on a Linux system usually requires the following steps:
##1. Enter the Tomcat directory:
Use the terminal to enter the Tomcat installation directory. For example, if Tomcat is installed in /opt/tomcat, you can use the following command to enter the directory:
cd /opt/tomcat
2. Execute the startup script:
In Tomcat's bin directory, there is a script file named catalina.sh (or catalina.bat on Windows), which is used to start Tomcat. On Linux, you can use the following command to execute the startup script:
./bin/catalina.sh start
If there are permission issues, you may need to add execution permissions, you can use the following command:
chmod +x ./bin/catalina.sh
3. Wait for Tomcat to start:
It may take some time for Tomcat to start. Once the startup is complete, you should see some startup logs in the terminal, and Tomcat will be listening for connections on the default port 8080.
4. Check whether Tomcat has started:
You can use the following command to check whether Tomcat has started:
./bin/catalina.sh status
Or view the catalina.out file, which is usually located in the logs directory, to obtain a more detailed startup log:
tail -f logs/catalina.out
5 , Access the Tomcat management page:
Open a web browser and access the Tomcat management page, usually through the following URL:
http://localhost:8080
If everything goes well, you should be able to see Tomcat's welcome page.
6. Stop Tomcat (optional):
If you need to stop Tomcat, you can use the following command:
./bin/catalina.sh stop
Or on Windows:
./bin/catalina.bat stop
Note: In some cases it may be necessary to use ./bin/shutdown.sh or . /bin/shutdown.bat command to stop Tomcat.
The above is the detailed content of How to start tomcat in linux. For more information, please follow other related articles on the PHP Chinese website!