Installation of the CentOS Tomcat

Source: Internet
Author: User

1. Environmental description

System: CentOS, 2.6.32-573.el6.x86_64;

tomcat:apache-tomcat-7.0.68

2. Download the file and upload it

Download Apache-tomcat-7.0.68.zip,crt rz-y upload to the/opt directory

Decompression: Unzip-o Apache-tomcat-7.0.68.zip

3. Modify File Permissions

chmod u+x/opt/apache-tomcat-7.0.68/bin/*.sh

If not modified, can not start tomcat!

4. Start the service

/opt/apache-tomcat-7.0.68/bin/startup.sh

5. LAN Access settings

Vi/etc/sysconfig/iptables

Add as Downstream

-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT

After adding the following:

-A input-m state--state established,related-j ACCEPT
-A input-p icmp-j ACCEPT
-A input-i lo-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 8080-j ACCEPT
-A input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
-A input-j REJECT--reject-with icmp-host-prohibited
-A forward-j REJECT--reject-with icmp-host-prohibited

note the location, at first I added to finally, LAN still inaccessible, and then moved to SSH 22 Port line above the line, the specific reason is unclear

Restart Iptables Service

Service iptables Restart;

6. Automatically start Tomcat

A simple boot-up configuration:
Vi/etc/rc.d/rc.local
Finally add the following content
Export jdk_home=/opt/jdk1.7.0_80
Export java_home=/opt/jdk1.7.0_80
/opt/apache-tomcat-7.0.68/bin/startup.sh

Installation of the CentOS 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.