CentOS installation and configuration: Tomcat 7
1. Download tomcat
Download the latest tomcat version.
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
Music apache-tomcat-7.0.59.tar.gz tomcat7
3. 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 give the File Execution permission and make the configuration take effect
# Source/etc/profile
# Cd/usr/local/tomcat7/bin
# Chmod 777 *.*
4. Configure tomcat
(1) Add tomcat to start automatically
Echo "source/etc/profile">/etc/rc. d/rc. local
Echo "/usr/local/tomcat1/bin/startup. sh">/etc/rc. d/rc. local
It should be noted that rc. local is executed before/etc/profile, so the JAVA environment variable is not available,
So add the code: source/etc/profile before startup. sh so that you can
V. Test
# Cd/usr/local/tomcat1/bin
#./Startup. sh is displayed as follows:
This article is from the "Linux is belong to you" blog, please be sure to keep this source http://jwh5566.blog.51cto.com/7394620/1629113