Linux shortcut to start tomcat

Source: Internet
Author: User
Linux shortcut to start atat1. script path/etc/init. d/tomcat: run vi/etc/init. d/tomcat press a to edit the following content according to your own situation (mainly modify/usr/local/tomcat6/bin/) and copy it to the edit box, esc return... linux shortcut to start tomcat 1. script path/etc/init. d/tomcat: run vi/etc/init. d/tomcat press a to edit the following content according to your own situation (mainly modify/usr/local/tomcat6/bin/), copy it to the edit box, and exit the editing by esc,: wq save and exit Java code #! /Bin/bash # Description: start or stop the tomcat # Usage: tomcat [start | stop | reload | restart] # export PATH = $ PATH: $ HOME/bin export BASH_ENV = $ HOME /. bashrc export USERNAME = "root" case "$1" in start) # startup the tomcat echo-n "tomcat start:" cd/home/tomcat-bdcServer/bin. /startup. sh echo "Tomcat started" tail-f/home/tomcat-bdcServer/logs/log. log # print logs; stop) # stop tomcat echo-n "tomcat stop: "ps-ef | grep" java "| grep-v grep | sed's/[] */:/g' | cut-d: -f2 | kill-9 'cat' cd/usr/local/tomcat6/work rm-rf Catalina echo "Tomcat stopped"; reload | restart) $0 stop $0 start; *) echo "usage: tomcat [start | stop | reload | restart]" exit 1 esac exit 0 2. change the tomcat script to the executable file chmod + x/etc/init. d/tomcat 3. to execute this script in any path, you need to add the Java code 1 to the/usr/bin directory. [root @ localhost] # cd/usr/bin 2. [root @ localhost] # ln-s/etc/init. d/tomcat.
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.