1. Download the Linux version of Tomcat and JRE
Tomcat Download: Http://pan.baidu.com/s/1nt7D87J;
JRE Download: Http://pan.baidu.com/s/1sj4hAVV;
After the download is complete, upload to/usr/local (directory customization)
2. Installing the JRE
#chmod u+x./jre-6u26-linux-i586-rpm.bin Executable Permissions #./jre-6u26-linux-i586-rpm.bin
3. Install Tomcat
TAR-ZXVF APACHE-TOMCAT-6.0.39.TAR.GZMV apache-tomcat-6.0.39 Tomcat
4. Configure Environment variables
Vim. BASHRC Add export jre_home=/usr/java/jre1.6.0_26export classpath= $CLASSPATH: $JRE _home/libexport path= $JRE _home/ Bin: $PATH: $HOMR/bin or vim/etc/profile add export jre_home=/usr/java/jre1.6.0_26export classpath= $CLASSPATH: $JRE _home /libexport path= $JRE _home/bin: $PATH: $HOMR/bin
source. BASHRC (Source/etc/profile) takes the environment variable into effect, fully or by restarting
5. Modify the default port
Vim/usr/local/tomcat/conf/server.xml change the 8080 port in the file to the desired port, such as 8081PS: Check port usage before modifying port Netstat-npa
6. Shut down the network firewall
/sbin/service iptables Stop or add 8081 port to the network firewall vim/usr/local/palladium/pldacl/sbin/iptables-a input-p TCP--dport 8081 -j ACCEPT
7. Open Tomcat Service
/usr/local/tomcat/bin/startup.sh/usr/local/tomcat/bin/shutdown.sh Close Service
8. Visit
http://ip:8081
Note: To shut down the network firewall before accessing
9. Add the following port access rules to the/etc/sysconfig/iptables file
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 8081-j ACCEPT
10. Other commands
Java-version View the JRE version Ps-ef|grep Tomcat view Tomcat process echo $JRE _homechkconfig iptables off permanently shut down the firewall
Environment for Tomcat and JRE built under Linux