升级 Apache Tomcat的办法
Posted 黄海的编程知识世界
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了升级 Apache Tomcat的办法相关的知识,希望对你有一定的参考价值。
1、下载最新的7系列tomcat
cd /usr/local/software
wget https://www-us.apache.org/dist/tomcat/tomcat-7/v7.0.92/bin/apache-tomcat-7.0.92.tar.gz
tar -zxvf apache-tomcat-7.0.92.tar.gz
2、
rm -rf /usr/local/tomcat7_old
mv /usr/local/tomcat7 /usr/local/tomcat7_old
mv apache-tomcat-7.0.92 /usr/local/tomcat7
cd /usr/local/tomcat7/bin/
#追加文本行
sed -i -e ‘/#!/bin/sh/aexport CATALINA_HOME=/usr/local/tomcat7‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘/#!/bin/sh/aexport TOMCAT_HOME=/usr/local/tomcat7‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘/#!/bin/sh/aJAVA_HOME=/usr/java/jdk1.7.0_80‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘/# OS specific support. $var _must_ be set to either true or false./aJAVA_OPTS="-Xms1024m -Xmx2048m -Xss1024K -XX:PermSize=512m -XX:MaxPermSize=1024m"‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘s/redirectPort="8443"/redirectPort="8443" URIEncoding="UTF-8"/g‘ /usr/local/tomcat7/conf/server.xml
cd /usr/local/tomcat7/bin/
chmod +x *.*
# 删除系统自带的小猫和例子
cd /usr/local/tomcat7/webapps
rm -rf host-manager
rm -rf examples
rm -rf manager/
rm -rf docs
3、移动旧的项目回来
cd /usr/local/tomcat7_old
cd webapps
mv *.* /usr/local/tomcat7/webapps
4、重新启动tomcat即可
以上是关于升级 Apache Tomcat的办法的主要内容,如果未能解决你的问题,请参考以下文章
Apache2 HTTPD(v2.4.23)后面的Tomcat(v7.0.47):Java升级后连接失败