Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of starting tomcat under Linux

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article analyzes "what is the method to start tomcat under Linux". The content is detailed and easy to understand. Friends who are interested in "what is the way to start tomcat under Linux" can follow the editor's train of thought to read it slowly and deeply. I hope it will be helpful to everyone after reading. Let's follow the editor to learn more about "what is the way to start tomcat under Linux".

Tomcat is started at random, so when you start the server, you have to open tomcat manually, otherwise you can't access it. )

1: find the tomcat installation path

[root@localhost] # cd. (return to the previous directory) [root@localhost /] # ls (list all files in this directory) bin dev home lib64 media mnt opt root selinux sys tmp var boot etc lib lost+found misc net proc sbin srv tftpboot usr [root@localhost /] # cd var (open the var folder) [root@localhost var] # ls (view the list of files) account crash empty gdm local mail opt run tuxarpwatch cvs ftp kerberos lock named preserve spool wwwcache db games Lib log nis racoon tmp yp (does not appear to be in the var folder Can only be returned to the previous directory) [root@localhost var] # cd.. [root@localhost /] # cd usr [root@localhost usr] # ls

2.sql

Etc java lib64 sbin tmpapache-tomcat-7.0.14.tar games kerberos libexec share tomcat7.0 bin include lib local src X11R6 [root@localhost usr] # cd tomcat7.0 (open the tomcat7.0 folder) [root@localhost tomcat7.0] # ls bin hsperfdata_root LICENSE NOTICE RUNNING.txt webappsconf lib logs RELEASE-NOTES temp work [root@localhost tomcat7.0] # cd bin [root@localhost bin] # ls bootstrap.jar Configtest.sh setclasspath.sh tomcat-native.tar.gzcatalina.bat cpappend.bat shutdown.bat tool-wrapper.batcatalina.sh d: shutdown.sh tool-wrapper.shcatalina-tasks.xml digest.bat startup.bat version.batcommons-daemon.jar digest.sh startup.sh version.shcommons-daemon-native.tar.gz setclasspath.bat tomcat-juli.jar [root@localhost bin] #. / (current directory It is not clear what this is for. )-bash:. /: is a directory [root@localhost bin] #. / startup.sh (start Tomcat) Using CATALINA_BASE: / usr/tomcat7.0Using CATALINA_HOME: / usr/tomcat7.0Using CATALINA_TMPDIR: / usr/tomcat7.0Using JRE_HOME: / usr/java/jdk1.6.0_24Using CLASSPATH: / usr/tomcat7.0/bin/bootstrap.jar:/usr/tomcat7.0/bin/tomcat-juli.jar

Started successfully

2: view the log of tomcat

[root@localhost bin] # cd.. [root@localhost tomcat7.0] # ls bin hsperfdata_root LICENSE NOTICE RUNNING.txt webappsconf lib logs RELEASE-NOTES temp work [root@localhost tomcat7.0] # cd logs (Open Log folder) [root@localhost logs] # ls catalina.2011-05-30.log localhost.2011-06-28.logcatalina.out localhost_access_log.2011-06-27.txthost-manager.2011-05-30.log localhost_access_log.2011-07 -07.txt (useless don't post) [root@localhost logs] # tail-f catalina.out (check tomcat's log file)

Start, shut down and kill process of Tomcat under ps:Linux

Cd / java/tomcat\ # execute bin/startup.sh # start tomcat bin/shutdown.sh # stop tomcat tail-f logs/catalina.out # see the console output of tomcat \ # see if there is already a tomcat running ps-ef | grep tomcat\ # if so, use kill Kill-9 pid # pid is the corresponding process number such as ps-ef | the grep tomcat output is as follows: sun 5144 10 10:21 pts/1 00:00:06 / java/jdk/bin/java-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager-Djava.endorsed.dirs=/java/tomcat/common/endorsed-classpath: / java/tomcat/bin/bootstrap.jar:/java/tomcat/bin/commons-logging-api.jar-Dcatalina.base=/java/tomcat-Dcatalina.home=/java/tomcat -Djava.io.tmpdir=/java/tomcat/temp org.apache.catalina.startup.Bootstrap start 5144 is the process number pid = 5144 kill-9 5144 to completely kill tomcat\ # directly view the process pid netstat-anp on the specified port | grep 9217\ # the result is tcp 0: 9217: *

LISTEN 26127/java

# then 26127 is the pid of the tomcat process on port 9217, and then you can kill the process

Kill-9 26127

# and then start tomcat.

What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.

About the method of starting tomcat under Linux is shared here, I hope that the above content can make you improve. If you want to learn more knowledge, please pay more attention to the editor's updates. Thank you for following the website!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report