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