First, download Tomcat
Download the latest version of Tomcat
Cd/usr/local/src
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.50/bin/apache-tomcat-7.0.59.tar.gz
Ii. Unzip and install Tomcat
Tar zxvf apache-tomcat-7.0.59.tar.gz
MV Apache-tomcat-7.0.59.tar.gz TOMCAT7
Third, configure environment variables
Vi/etc/profile
Export java_home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64
Export JRE_HOME=/USR/LIB/JVM/JAVA-1.7.0-OPENJDK-1.7.0.9.X86_64/JRE
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
Cd/usr/local/tomcat7/bin
VI catalina.sh
#!/bin/sh
Export TOMCAT_HOME=/USR/LOCAL/TOMCAT7
Export CATALINA_HOME=/USR/LOCAL/TOMCAT7
Use the following command to have the file execute permissions and make the configuration effective
# Source/etc/profile
# Cd/usr/local/tomcat7/bin
# chmod 777 * *
Iv. Configuring Tomcat
(1) Adding Tomcat to boot
echo "Source/etc/profile" >>/etc/rc.d/rc.local
echo "/usr/local/tomcat1/bin/startup.sh" >>/etc/rc.d/rc.local
Here is a bit to explain, rc.local before/etc/profile execution, so will not get the Java environment variable,
So add the code before startup.sh: Source/etc/profile so you can
V. Testing
# Cd/usr/local/tomcat1/bin
#./startup.sh appears as normal
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5D/10/wKioL1UhBFXw2pNkAAZxrN0aH6E173.jpg "title=" Tomcat "alt=" Wkiol1uhbfxw2pnkaazxrn0ah6e173.jpg "/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/5D/10/wKioL1UhB63jZNtPAAGj3RIXVyk733.jpg "title=" Tomcat2 "alt=" Wkiol1uhb63jzntpaagj3rixvyk733.jpg "/>
This article is from the "Linux is belong to You" blog, make sure to keep this source http://jwh5566.blog.51cto.com/7394620/1629113
CentOS-6.4 installation Configuration Tomcat7