First, install the JDK1. Place the JDK according to your preference, I put it under/usr/java #cd/usr#mkdir java#cd#tar zxvf jdk-7u71-linux-x64.gz-c/usr/java 2. Add environment variable #vi/ Etc/profile at the end of the file plus java_home=/usr/java/jdk1.7.0_71jre_home= $JAVA _home/jrepath= $PATH: $JAVA _home/bin: $JRE _home/bin
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib
Export Java_home jre_home PATH CLASSPATH Save exit execution make changes effective #source/etc/profile see if installation succeeded #java-version Install TOMCAT1. Place the tomcat position according to your preference, I put it under/usr/tomcat # cd/usr#mkdir Tomcat#cd#tar zxvf APACHE-TOMCAT-7.0.56.TAR.GZ#MV apache-tomcat-7.0.56/*/usr/tomcat/2. Configure Tomcat#cd/usr/tomcat/bin#vi catalina.sh Enter export Tomcat_home=/usr/tomcat at the end
Export Catalina_home=/usr/tomcat # Source/etc/profile
# Cd/usr/tomcat/bin
# chmod 777 * * 3. Join the boot #echo "Source/etc/profile" >>/etc/rc.d/rc.local
#echo "/usr/tomcat/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 code before startup.sh: Source/etc/profile so you can 4. Test #/usr/tomcat/bin /startup.sh open a browser to access HTTP.//Your ip:8080
CentOS Install Tomcat