- 下载安装tomcat
mkdir /tools
cd /tools
wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.82/bin/apache-tomcat-7.0.82.tar.gz
tar xf apache-tomcat-7.0.82.tar.gz -C /usr/local
ln -sv /usr/local/apache-tomcat-7.0.82/ /usr/local/tomcat
- 设置环境变量:vim /etc/profile.d/tomcat.sh
export CATALINA_HOME=/usr/local/tomcat
export CATALINA_BASE=/usr/local/tomcat
export PATH=$CATALINA_HOME/bin:$PATH
- 配置生效
chmod +x /etc/profile.d/tomcat.sh
source /etc/profile.d/tomcat.sh