Home >Operation and Maintenance >Linux Operation and Maintenance >Introduction to how to use tomcat under linux

Introduction to how to use tomcat under linux

零下一度
零下一度Original
2017-06-17 11:00:491910browse

This article mainly introduces the common operations of tomcat under linux. Friends who need it can refer to it

Assume that tomcat is installedin /usr/local/tomcat7

Start tomcat


cd /usr/local/tomcat7/bin
./startup.sh

View startupstatus


ps -ef|grep java
root  3729 1729 6 09:23 pts/2  00:00:03 /usr/lib/jvm/java-8-openjdk-i386//bin/java -Djava.util.logging.config.file=/usr/local/tomcat7/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.endorsed.dirs=/usr/local/tomcat7/endorsed -classpath /usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat7 -Dcatalina.home=/usr/local/tomcat7 -Djava.io.tmpdir=/usr/local/tomcat7/temp org.apache.catalina.startup.Bootstrap start
dafu71  3770 3706 0 09:24 pts/2  00:00:00 grep --color=auto java

Kill tomcat process:


kill -9 3729

Check the startup status again


ps -ef|grep java
root  3777 3706 0 09:26 pts/2  00:00:00 grep --color=auto java

Start tomcat again


./startup.sh

View log

Enter tomcat/logs


##

cd ../
cd logs
tail -f catalina.out

Termination viewing


ctr+z

Stop tomcat service


cd /usr/local/tomcat7/bin
./shutdown.sh
ps -ef | grep 解释

ps: Display a certain process

-A Display all programs.

-e The effect of this parameter is the same as specifying the "A" parameter.
-f Display UID, PPIP, C and STIME fields.

The grep command is to find the | in the middle of

. The pipe command means that the ps command and grep are executed at the same time.

Get the operation permission of a folder


sudo chmod -R 777 文件夹路径

The three permissions of reading, writing, and running can be represented by numbers, that is, r=4, w=2, x=1.

rw-r--r-- is expressed as 644 numerically.

777 is rwxrwxrwx, which means that the logged-in user (you can view it with the command id),

his group and others have the highest permissions

The above is the detailed content of Introduction to how to use tomcat under linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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