web的Tomcat8部署文档

需要的软件包如下:
apache-tomcat-8.0.33.tar.gz
apache-tomcat-8.5.15.tar.gz
jdk-8u131-linux-x64.tar.gz


1.JDK部署方法:
tar -zxf jdk-8u131-linux-x64.tar.gz -C /apps/svr/
mv jdk1.8.0_131 jdk
cd ~apps
cat >> .bashrc <<EOF
export JAVA_HOME=/apps/svr/jdk
export JRE_HOME=/apps/svr/jdk/jre
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin:$CLASSPATH
EOF 
source .bashrc
java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)


2.shop-mobile-web部署方法:
mkdir -p /apps/svr/tomcat_mall
tar zxf apache-tomcat-8.0.33.tar.gz -C /apps/svr/tomcat_mall/
mv apache-tomcat-8.0.33 apache-tomcat-8.0.33_8080
cd apache-tomcat-8.0.33_8080/conf
vim server.xml
#修改如下:
#说明:8443改为8415,8009改为8015.
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8415" URIEncoding="UTF-8" />
<Connector port="8015" protocol="AJP/1.3" redirectPort="8415" />

#增加Session共享配置:

vim  context.xml

<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context>

<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded. -->
<WatchedResource>WEB-INF/web.xml</WatchedResource>

<Valve className="com.orangefunction.tomcat.redissessions.RedisSessionHandlerValve" /> 
<Manager className="com.orangefunction.tomcat.redissessions.RedisSessionManager" 
timeout="300000"
maxRedirections="6"
maxWaitMillis="-1"
maxTotal="1000"
minIdle="8"
maxIdle="100"
redisNodes="redisIP:PORT,redisIP1:PORT1,redisIP2:PORT2,redisIP3:PORT3,redisIP4:PORT4,redisIP5:PORT5" />
<!-- Uncomment this to disable session persistence across Tomcat restarts -->
<!--

192.168.100.7:7005,192.168.100.7:7004,192.168.100.4:7003,192.168.100.3:7000,192.168.100.3:7001,192.168.100.4:7002
192.168.100.82:7004,192.168.100.4:7002,192.168.100.4:7003,192.168.100.3:7000,192.168.100.3:7001,192.168.100.82:7005
<Manager pathname="" />
-->

<!-- Uncomment this to enable Comet connection tacking (provides events
on session expiration as well as webapp lifecycle) -->
<!--
<Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
-->
</Context>


cd /apps/svr/tomcat_mall/apache-tomcat-8.0.33_8080/bin
#启动内存限制:例如32G物理内存就是如下配置,目前生产也使用如下配置
vi setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms16384m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx16384m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=2048m"
chmod +x setenv.sh
#启动tomcat服务:
./startup.sh


3.shop-timer-web部署方法:
tar zxf apache-tomcat-8.5.15.tar.gz -C /apps/svr/tomcat_mall/
cd /apps/svr/tomcat_mall/
cp -rf apache-tomcat-8.5.15 apache-tomcat-8.5.15_8086
cd /apps/svr/tomcat_mall/apache-tomcat-8.5.15_8086/conf
vim server.xml
#修改如下:
#说明:8005改为8011,8080改为8086,8443改为8449,8009改为8039.
<Connector port="8086" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8449" URIEncoding="UTF-8" />
<Connector port="8039" protocol="AJP/1.3" redirectPort="8449" />
cd /apps/svr/tomcat_mall/apache-tomcat-8.5.15_8086/bin
#启动内存限制:例如32G物理内存就是如下配置,目前生产也使用如下配置
vi setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms16384m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx16384m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=2048m"
chmod +x setenv.sh
#启动tomcat服务:
./startup.sh


4.shop-admin-web部署方法:
mv /apps/svr/tomcat_mall/apache-tomcat-8.5.15 /apps/svr/tomcat_mall/apache-tomcat-8.5.15_8087
cd /apps/svr/tomcat_mall/apache-tomcat-8.5.15_8087/conf
vim server.xml
#修改如下:
#说明:8005改为8012,8080改为8087,8443改为8450,8009改为8019.
<Connector port="8087" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8450" URIEncoding="UTF-8" />
<Connector port="8019" protocol="AJP/1.3" redirectPort="8450" />
cd /apps/svr/tomcat_mall/apache-tomcat-8.5.15_8087/bin
#启动内存限制:例如32G物理内存就是如下配置,目前生产也使用如下配置
vi setenv.sh
export CATALINA_OPTS="$CATALINA_OPTS -Xms16384m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx16384m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=2048m"
chmod +x setenv.sh
#启动tomcat服务:
./startup.sh

原文地址:https://www.cnblogs.com/hyming011/p/8252571.html