Java Enterprise Application Tomcat Combat (ii)

Source: Internet
Author: User

Run with a normal user

It is safer to deploy a service with a normal user

1001 for new password:passwd:all authentication Tokens updated Successfully.
switch to Tomcat to execute [[email protected] application]# chown-R tomcat:tomcat/application/Jdk[[email protected] application]# chown-R tomcat:tomcat/application/tomcat/[email protected] application]# su-Tomcat [[email protected]-node1 ~]$ cd/application/tomcat/bin/[[Email protected]-node1 bin]$ sh startup.sh #启动脚本Using catalina_base:/application/tomcatusing catalina_home:/application/tomcatusing Catalina_tmpdir:/application/tomcat/tempusing jre_home:/application/jdkusing CLASSPATH:/application/tomcat/bin/bootstrap.jar:/application/tomcat/bin/tomcat-Juli.jartomcat started.
[[Email protected]node1 tomcat]$ pwd/application/Tomcat[[email protected]-node1 tomcat]$ LS-Ltotal -drwxr-xr-x5Tomcat Tomcat4096Apr9  -: -BINDRWXR-xr-x6Tomcat Tomcat4096Apr8 Ten: theCONFDRWXR-xr-x2Tomcat Tomcat4096Apr8  to: theLib-rw-r--r--1Tomcat Tomcat57011Sep -   -LICENSEDRWXR-xr-x2Tomcat Tomcat4096Apr9  -: thelogs-rw-r--r--1Tomcat Tomcat1444Sep -   -NOTICE-rw-r--r--1Tomcat Tomcat6741Sep -   -release-NOTES-rw-r--r--1Tomcat Tomcat16204Sep -   -RUNNING.TXTDRWXR-xr-x2Tomcat Tomcat inApr8  to: theTemp DRWXR-xr-x8Tomcat Tomcat108Apr8  the: -WEBAPPSDRWXR-xr-x3Tomcat Tomcat +Apr8  to: -Work

The temporary files and working files are placed in temp and work when they are started, and they are recommended to be emptied each time they are started at the time of production.

Tomcat uses its own scripts sometimes to kill the process, write a script

#!/bin/Shjava_home=/application/Jdkcatalina_home=/application/Tomcatusage () {echo"$ {Start|stop|restart}"Exit1}[ $# -ne1]&&Usagestart_tomcat () {$CATALINA _home/bin/Startup.sh}stop_tomcat () {TPID=$ (Ps-aux|grep java|grep Tomcat|awk'{print $}') Kill-9$TPIDsleep5; Tstat=$ (Ps-aux|grep java|grep Tomcat|awk'{print $}')if[ -z $TSTAT];then echo"Tomcat Stop"ElseKill-9$TSTATfi} Case$1 inchstart) start_tomcat;; stop) Stop_tomcat;; Restart) Stop_tomcat Sleep5start_tomcat;;*) usage;; Esac
[[Email protected] ~]$ sh tomcat.sh tomcat.sh {start|stop| Restart} [Email protected]-node1 ~]$ sh tomcat.sh startusing catalina_base:   /application/tomcatusing Catalina_home:   /application//application/tomcat/tempusing jre_home:        /application /jdkusing CLASSPATH:       /application/tomcat/bin/bootstrap.jar:/application/tomcat/bin/tomcat-  Juli.jartomcat started.


The default listener is port 8080.

[Email protected] ~]$ netstat-ntpl|grep java (not all processes could is identified, non-owned process info is not being shown, you would has to be the root to see it all.) TCP60      0:::8009:::* LISTEN4220/Java TCP60      0:::8080:::* LISTEN4220/Java TCP60      0 127.0.0.1:8005:::* LISTEN4220/java

Java Enterprise Application Tomcat Combat (ii)

Related Article

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.