Home > Java > javaTutorial > How to start tomcat in linux

How to start tomcat in linux

小老鼠
Release: 2024-01-05 16:34:05
Original
2079 people have browsed it

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.

How to start tomcat in linux

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
Copy after login

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
Copy after login

If there are permission issues, you may need to add execution permissions, you can use the following command:

chmod +x ./bin/catalina.sh
Copy after login

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
Copy after login

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
Copy after login

5 , Access the Tomcat management page:

Open a web browser and access the Tomcat management page, usually through the following URL:

http://localhost:8080
Copy after login

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
Copy after login

Or on Windows:

./bin/catalina.bat stop
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template