"Go" Install Tomcat on CentOS

Source: Internet
Author: User

Original link: http://www.cnblogs.com/xsi640/p/3757015.html

Another more detailed blog post: http://blog.csdn.net/zhngjan/article/details/25223423

Download the latest GZ installation package from the Tomcat website first

File name: apache-tomcat-8.0.8.tar.gz

Upload the file to the/usr/local directory

Perform decompression

Tar zxvf apache-tomcat-8.0.8.tar.gz

Name the directory apache-tomcat-8.0.8 tomcat

MV apache-tomcat-8.0.8 Tomcat

Running/usr/local/tomcat/bin/startup.sh will start Tomcat

To configure the auto-start script:

#!/bin/bash## Tomcat startup script forThe Tomcat server## chkconfig:345  the  -# Description:start The Tomcat deamon## Source function library./etc/rc.d/init.d/Functionsprog=Tomcatjava_home=/usr/java/jdk1.6. 0_27export Java_homecatalana_home=/usr/local/Tomcatexport catalina_home Case " $" inchstart) echo"starting Tomcat ..."$CATALANA _home/bin/startup.sh;; Stop) Echo"stopping Tomcat ..."$CATALANA _home/bin/shutdown.sh;; Restart) echo"stopping Tomcat ..."$CATALANA _home/bin/shutdown.sh Sleep2Echo Echo"starting Tomcat ..."$CATALANA _home/bin/startup.sh;;*) echo"Usage: $prog {Start|stop|restart}"    ;; Esacexit0

Name the file tomcat and put it in the/etc/init.d/directory

Modify permissions, you can run

chmod +x/etc/init.d/tomcat

Set up start-up service automatically

sudo chkconfig tomcat on

Start the service:

Service Tomcat Start

Stop service:

Service Tomcat Stop

Configure the firewall to open the corresponding port:

Vi/etc/sysconfig/iptables
-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT

Restarting the firewall

Service Iptables Restart

"Go" Install Tomcat on CentOS

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.