How to see if Tomcat starts/system logs, etc. under Linux

Source: Internet
Author: User

1, under the Linux system, restart Tomcat to use the command to operate!

Method One:

First, go to the bin directory under Tomcat

Cd/usr/local/tomcat/bin

Using the Tomcat Close command

./shutdown.sh

To see if Tomcat is shutting down

Ps-ef|grep Java

If the following similar information is displayed, Tomcat is not turned off

Root      7010     1  0 Apr19?        00:30:13/usr/local/java/bin/java-djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties- Djava.awt.headless=true-dfile.encoding=utf-8-server-xms1024m-xmx1024m-xx:newsize=256m-xx:maxnewsize=256m-xx: Permsize=256m-xx:maxpermsize=256m-xx:+disableexplicitgc-djava.util.logging.manager= org.apache.juli.classloaderlogmanager-djava.endorsed.dirs=/usr/local/tomcat/endorsed-classpath/usr/local/ tomcat/bin/bootstrap.jar-dcatalina.base=/usr/local/tomcat-dcatalina.home=/usr/local/tomcat-djava.io.tmpdir=/ Usr/local/tomcat/temp org.apache.catalina.startup.Bootstrap Start

* If you want to kill Tomcat directly, you can use the KILL command to kill the Tomcat process directly

Kill-9 7010

Then continue to see if Tomcat shuts down

Ps-ef|grep Java

If the following information is present, Tomcat is turned off

Root      7010     1  0 Apr19?        

Finally, start Tomcat

./startup.sh


Method Two:

I don't know what your directory structure is like under Linux. Here are some of the steps I'm going to use to inspire you

-cd/tomcat7/logs/
-tail-f catalina.out (catalina.out is the console log file)

Tomcat starts off common commands:


After booting, shutting down, and error tracking for the Tomcat service under Linux, using Putty to connect remotely to the server, you typically start the shutdown Tomcat service in several ways:
Switch to the bin directory under the Tomcat home directory (CD Usr/local/tomcat/bin)

1. Start the Tomcat service
Mode one: Direct start./startup.sh
Mode two: Start nohup as a service./startup.sh &
Mode three: the console dynamic output mode starts./catalina.sh Run dynamically displays the console output information of the Tomcat daemon, and then exits and closes the service after CTRL + C
Explain:
Through the way one, the way the Tomcat has a disadvantage, when the client connection disconnects, the Tomcat service will stop immediately, through the two can be run as a Linux service
Tomcat initiated by way one, mode two, its log will be written to the corresponding log file, and can not dynamically view the Tomcat console output information and error conditions, through the way three can start the Tomcat service in console mode,
directly see the program Runtime background console output information, do not have to be very troublesome to open the Catalina.out log file for viewing, so that it is easy to track the background output information. The Tomcat console information includes information such as log4j and System.out.println () output.

2. Turn off Tomcat service
./shutdown.sh

2. Start
Kill: Kill-9 5144
View the Tomcat run log in real time------------------------Linux-------------------------

1, first switch to: CD tomcat/logs

2, Tail-f Catalina.out

3, so that the runtime can view the running log in real time

CTRL + C is the exit Tail command.

How to see if Tomcat starts/system logs, etc. under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.