linux下tomcat操作

启动tomcat:进入tomcat下的bin目录,输入 ./startup.sh 启动tomcat;
停止tomcat:bin目录下,输入 ./shutdown.sh
显示所有进程:ps -fe
显示tomcat进程: ps -ef |grep tomcat
显示如下:
[root@localhost ~]# ps -ef |grep tomcat
root 7277 1 2 21:29 pts/1 00:01:17 /usr/java/jdk1.5.0_06/bin/java -Xms256m -Xmx512m -Xss1024K -XX:PermSize=128m -XX:MaxPermSize=256m -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/java/tomcat/apache-tomcat-5.5.20/conf/logging.properties -Djava.endorsed.dirs=/usr/java/tomcat/apache-tomcat-5.5.20/common/endorsed -classpath :/usr/java/tomcat/apache-tomcat-5.5.20/bin/bootstrap.jar:/usr/java/tomcat/apache-tomcat-5.5.20/bin/commons-logging-api.jar -Dcatalina.base=/usr/java/tomcat/apache-tomcat-5.5.20 -Dcatalina.home=/usr/java/tomcat/apache-tomcat-5.5.20 -Djava.io.tmpdir=/usr/java/tomcat/apache-tomcat-5.5.20/temp org.apache.catalina.startup.Bootstrap start
root 7740 7705 0 22:20 pts/2 00:00:00 grep tomcat
root 31105 1 0 Aug10 ? 00:00:10 /usr/java/jdk1.5.0_06/bin/java -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=/usr/java/tomcat/apache-tomcat-5.5.20-test/conf/logging.properties -Djava.endorsed.dirs=/usr/java/tomcat/apache-tomcat-5.5.20-test/common/endorsed -classpath :/usr/java/tomcat/apache-tomcat-5.5.20-test/bin/bootstrap.jar:/usr/java/tomcat/apache-tomcat-5.5.20-test/bin/commons-logging-api.jar -Dcatalina.base=/usr/java/tomcat/apache-tomcat-5.5.20-test -Dcatalina.home=/usr/java/tomcat/apache-tomcat-5.5.20-test -Djava.io.tmpdir=/usr/java/tomcat/apache-tomcat-5.5.20-test/temp org.apache.catalina.startup.Bootstrap start

7277和7740即为tomcat进程。
结束进程:kill -9 7277或7740
就可以结束对应的tomcat 进程。(有时候tomcat会抽了。。。在一个项目中修改完代码,重启之后发现进不了网站,其实就是进程抽了,结束相应进程重启解决)

你可能感兴趣的:(tomcat)