In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how Linux starts tomcat service, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
Tomcat is started randomly, so you have to manually open tomcat when you open the server, otherwise you can't access it.
First cd into tomcat bin folder, and then you can try the following three ways to start:
First (current session started):./ startup.sh Effect:
tomcat starts in the background, and we can continue typing other commands in the current session, such as
ps -ef |grep 'tomcat' to see the tomcat service we just started:
You can see that its process id is 6951, and we can close it with the following command
Kill 6951 This startup method is directly started in the background, but not to let tomcat run in the background all the time. When we close the session window currently connected to linux, tomcat service will also be closed.
Second (current session start with log):./ catalina.sh Run Effect:
Different from the first method, the second method will display logs after starting, which means that the current Linux connection session has become a console and no other Linux commands can be entered. The same as the first method, when the current connection is closed, the tomcat service started this time will also be closed. Of course, after successful launch, we can also use ctrl + c to directly close the launch of tomcat in this link session.
The third type (background permanent start): the simplest way to write:
nohup ./ startup.sh & Manually specify tomcat startup log path:
nohup ./ startup.sh> log.file 2>&1 & To understand the difference between the two, it depends on how nohup is used:
>log.file is to redirect the output of command to the log.file, that is, the output is not printed to the screen, but output to the log.file file.
2>&1 redirects standard errors to standard output, where the standard output has been redirected to the log.file file, i.e. standard errors are also output to the log.file. The last & is for the command to execute in the background.
Consider what 2>1 represents, where 2 in combination with> represents an error redirect, and 1 represents an error redirect to a file 1 instead of standard output; 2>&1, where & in combination with 1 represents standard output, becomes an error redirect to standard output.
Thank you for reading this article carefully. I hope that the article "How to start tomcat service in Linux" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.