标签:max http perm chmod 最新 tomcat-7 系统 export chm
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/a\export CATALINA_HOME=\/usr\/local\/tomcat7‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘/#!\/bin\/sh/a\export TOMCAT_HOME=\/usr\/local\/tomcat7‘ /usr/local/tomcat7/bin/catalina.sh
sed -i -e ‘/#!\/bin\/sh/a\JAVA_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./a\JAVA_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即可
标签:max http perm chmod 最新 tomcat-7 系统 export chm
原文地址:https://www.cnblogs.com/littlehb/p/10036141.html