In CentOS Linux, start and stop tomcat and check the shell script and centostomcat logs.

Source: Internet
Author: User

In CentOS Linux, start and stop tomcat and check the shell script and centostomcat logs.

Tomcat installation directory of CentOS:/usr/local/tomcat

Vi MyTomcatUitl. sh create a file
Chmod u + x MyTomcatUtil. sh grant execution permission

Shell script:

1 #! /Bin/bash 2 3 # Start and Stop tomcat. The log shows script 4 5 if [$1 = '']; then 6 echo" run the command with a parameter: start tomcat, stop tomcat, logs view tomcat dynamic logs "7 exit 0 8 fi 9 10 if [$1 = 'start']; then11 cd/usr/local/tomcat/bin12. /startup. sh13 elif [$1 = 'stop']; then14 cd/usr/local/tomcat/bin15. /shutdown. sh16 elif [$1 = 'logs']; then17 cd/usr/local/tomcat/logs18 tail-f catalina. out19 else20 echo "parameter incorrect! Start, stop, logs view log "21 fi

 

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.