第一步 

添加tomcat环境变量

# vim /etc/profile
加入下代码

# TOMCAT

ATALINA_BASE=/usr/local/tomcat8
CATALINA_HOME=/usr/local/tomcat8
TOMCAT_HOME=/usr/local/tomcat8
export ATALINA_BASE CATALINA_HOME TOMCAT_HOME

修改应用环境变量,是配置生效
# source /etc/profile

第二步

cd  /usr/local/tomcat8/conf

vim server.xml

<?xml version='1.0' encoding='utf-8'?>
<!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements.  See the NOTICE file distributed withthis 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 withthe License.  You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed 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 andlimitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may notdefine subcomponents such as "Valves" at this level.Documentation at /docs/config/server.html-->
<Server port="8005" shutdown="SHUTDOWN"><Listener className="org.apache.catalina.startup.VersionLoggerListener" /><!-- Security listener. Documentation at /docs/config/listeners.html<Listener className="org.apache.catalina.security.SecurityListener" />--><!--APR library loader. Documentation at /docs/apr.html --><Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /><!-- Prevent memory leaks due to use of particular java/javax APIs--><Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /><Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /><Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /><!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--><GlobalNamingResources><!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--><Resource name="UserDatabase" auth="Container"type="org.apache.catalina.UserDatabase"description="User database that can be updated and saved"factory="org.apache.catalina.users.MemoryUserDatabaseFactory"pathname="conf/tomcat-users.xml" /></GlobalNamingResources><!-- A "Service" is a collection of one or more "Connectors" that sharea single "Container" Note:  A "Service" is not itself a "Container",so you may not define subcomponents such as "Valves" at this level.Documentation at /docs/config/service.html--><Service name="Catalina"><!--The connectors can use a shared executor, you can define one or more named thread pools--><!--<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"maxThreads="150" minSpareThreads="4"/>--><!-- A "Connector" represents an endpoint by which requests are receivedand responses are returned. Documentation at :Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)Java AJP  Connector: /docs/config/ajp.htmlAPR (HTTP/AJP) Connector: /docs/apr.htmlDefine a non-SSL/TLS HTTP/1.1 Connector on port 8080--><Connector port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443"URIEncoding="UTF-8" useBodyEncodingForURI="true" /><!-- A "Connector" using the shared thread pool--><!--<Connector executor="tomcatThreadPool"port="8080" protocol="HTTP/1.1"connectionTimeout="20000"redirectPort="8443" />--><!-- Define a SSL/TLS HTTP/1.1 Connector on port 8443This connector uses the NIO implementation that requires the JSSEstyle configuration. When using the APR/native implementation, theOpenSSL style configuration is required as described in the APR/nativedocumentation --><!--<Connector port="8443" protocol="org.apache.coyote.http11.Http11NioProtocol"maxThreads="150" SSLEnabled="true" scheme="https" secure="true"clientAuth="false" sslProtocol="TLS" />--><!-- Define an AJP 1.3 Connector on port 8009 --><Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /><!-- An Engine represents the entry point (within Catalina) that processesevery request.  The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --><!-- You should set jvmRoute to support load-balancing via AJP ie :<Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">--><Engine name="Catalina" defaultHost="localhost"><!--For clustering, please take a look at documentation at:/docs/cluster-howto.html  (simple how to)/docs/config/cluster.html (reference documentation) --><!--<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>--><!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --><Realm className="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase".  Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm.  --><Realm className="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm>
<!--<Host name="localhost"  appBase="webapps"unpackWARs="true" autoDeploy="true">
--><!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --><!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />--><!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using pattern="common" -->
<!--   <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt"pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host>
-->    <!--<Host appBase="webapps" autoDeploy="true" name="center" unpackWARs="true"><Context path="/db-center" docBase="/data/zhiqiyun/webapp/center"/><Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"prefix="localhost_access_log" suffix=".txt"pattern="%h %l %u %t &quot;%r&quot; %s %b" /></Host><Host appBase="webapps" autoDeploy="true" name="wox.woxiaoyun.com"  unpackWARs="true"><Context path="" docBase="/data/zhiqiyun/webapp/wox/showWeb"/></Host></Engine></Service>
</Server>

View Code

修改

1.<Server port="8005" shutdown="SHUTDOWN">

2.

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
URIEncoding="UTF-8"
useBodyEncodingForURI="true" />

3.

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

第三步


cd /usr/local/tomcat8/bin

vim catalina.sh

设置指向对应的base 文件地址

在文件顶部写入:

export JAVA_HOME=/usr/local/java/jdk1.8.0_20
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib.tools.jar

export CATALINA_BASE=$CATALINA_3_BASE

转载于:https://www.cnblogs.com/wylb/p/6371383.html

一台服务部署多个tomcat注意事项相关推荐

  1. linux部署多个tomcat服务,Linux 一台服务器部署多个tomcat

    linux系统下安装两个或多个tomcat 编辑环境变量:vi /etc/profile 加入以下代码(tomcat路径要配置自己实际的tomcat安装目录) ##########first tomc ...

  2. linux系统中同一台服务器部署两个tomcat

    参考资料:https://www.cnblogs.com/liulinghua90/p/9329031.html      里面描述十分详细,一定要去看这位大佬的资料!! 以下是我自己实践整理出来的, ...

  3. CentOS 6 同一台机器部署多个Tomcat应用服务器

    2019独角兽企业重金招聘Python工程师标准>>> 1. 修改/etc/profile文件 Linux代码 TOMCAT_HOME=/usr/share/tomcat6 CATA ...

  4. Tomcat服务部署和优化

    文章目录 一.Tomcat介绍 1.1 什么是Tomcat 1.2 Tomcat的构成组件 1.2.1 Java Servlet 介绍 1.2.2 JSP介绍 1.3 Tomcat顶层架构 1.3.1 ...

  5. tomcat服务部署与nginx负载均衡

    中间件产品介绍 ​ 目前来说IBM的WebSphere. Oracle的Weblogic占据了市场上Java语言Web站点的部分份额.该两种软件由于无与伦比的性能及可靠性等优势被广泛应用于大型互联网公 ...

  6. Tomcat简介、服务部署、虚拟主机配置及相关配置文件参数优化

    Tomcat简介.服务部署.虚拟主机配置及相关配置文件参数优化 一.Tomcat 简介 核心的组件 二.Tomcat 服务部署安装 1.关闭防火墙,将安装 Tomcat 所需软件包传到/opt目录下 ...

  7. 同一台服务器上部署多个Tomcat的配置修改方法

    同一服务器部署多个tomcat时,存在端口号冲突的问题,所以需要修改tomcat配置文件server.xml,以tomcat7为例. 首先了解下tomcat的几个主要端口: <Server po ...

  8. Tomcat服务部署

    一.Tomcat服务器简介 Tomcat服务器是一个免费的开放源代码的Web应用服务器,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP程序的首选. 一般 ...

  9. Tomcat服务部署及优化

    目录 一.Tomcat介绍 1.1Tomcat简介 1.2Tomcat核心组件 二.Tomcat功能组件结构 2.1Tomcat结构 2.2Container结构分析 2.3Tomcat请求过程 三. ...

最新文章

  1. word导入中的一个乱码
  2. 下次诺贝尔奖会是他吗?肠道微生物组领域开创者Jeffrey Gordon
  3. 分享超全的 Linux 渗透测试命令速查表
  4. 教你配置安全的ProFTPD服务器(中)
  5. mac android sdk manager速度慢,android - SDK Manager无法在Mac上打开 - 堆栈内存溢出
  6. 自定义 Git - Git 钩子
  7. PUSHA/POPA
  8. Python实时获取鼠标下窗口文本
  9. Qt富文本编辑器QTextDocument
  10. c++中double类型控制小数位数
  11. Java练习 SDUT-3338_计算各种图形的周长(接口与多态)
  12. linux的shell键盘输入,linux shell获取键盘输入
  13. gis怎么提取水系_ArcGIS提取水系并进行生态敏感性分析
  14. canvas实现动态小球碰撞
  15. 【JAVA SE基础篇】24.包的机制和import详解
  16. Kinect for Windows SDK v2.0 开发笔记 (七)语音识别(上)
  17. ESP车身电子稳定系统
  18. 扑克牌练习 【数据结构】
  19. dingo php,Laravel Lumen RESTFul API 扩展包:Dingo API(一) —— 安装配置篇
  20. 人脸扫描Canvas动画

热门文章

  1. java 封装 继承 堕胎_Java的继承、封装和多态
  2. 查询时拼接两列数据_如何用VBA代码查询两列数据差异?
  3. 解决java.net.ConnectException: Connection refused:connect报错
  4. 学习笔记~~~~LinkedHashMap
  5. docker查看命令帮助手册
  6. Win10技巧:16个系统优化设置小技巧,大幅度提升你的电脑性能!
  7. 开发工具:IDEA 调试技巧,非常实用,欢迎收藏!
  8. MYSQL:如何正确高效的使用 MySQL 索引?
  9. JQuery七个常犯的错误
  10. git pull 报错:The following untracked working tree files would be overwritten by merge