一台服务部署多个tomcat注意事项

第一步 

添加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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/284730.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

python 使用 sha256 函数对密码进行加密

在 hashlib 库中&#xff0c;可以使用 sha256 函数对密码进行加密。下面是一个示例代码&#xff1a; import hashlibdef hash_password(password):# 创建一个 sha256 对象sha256_hash hashlib.sha256()# 使用 update() 方法将密码传入 sha256 对象sha256_hash.update(passwor…

今天面试一个老程序员,号称自带资源,竟然是从所有前公司偷拷的源代码!...

说到“自带资源”&#xff0c;你会想到什么&#xff1f;一位程序员的“资源”令人震惊&#xff1a;竟然是从前公司偷的源代码&#xff01;一位网友说&#xff1a;今天面试一个老程序员&#xff0c;说自己有5年的开发经验&#xff0c;离职原因是上家公司倒闭了。上机测试啥都不会…

【ArcGIS风暴】根据海拔(坡度)范围分级统计土地覆盖的类型和面积(兰州市GlobeLand30m数据为例)

本文基于DEM和GlobeLand30m土地覆盖数据,讲解根据海拔范围和坡度范围分级逐级统计兰州市土地覆盖的类型和面积。 一、数据准备 1. DEM数据 海拔和坡度分级都要基于dem来实现。文中采用的DEM数据空间分辨率为30m,由甘肃省30mdem掩膜提取而来,加载如下所示: 2. 土地覆盖数据…

html5 弹性布局

html5 弹性布局 一、移动开发常用技巧 Viewport基本知识 设置布局Viewport的各种信息1、widthdevice-width&#xff1b; 设置Viewport视口宽度等于设备宽度2、initial-scale1&#xff1b; 网页默认缩放比为1(网页在手持设备上&#xff0c;不会进行默认缩放3、minimum-scale1 网…

Excel 宏代码实现按相同值分组设置背景颜色

AltF11&#xff0c;打开编辑器&#xff0c;按如下代码编写代码&#xff1a; Sub SetGroupBg()Dim i, j, cColors Array("#CEFFCE", "#D7FFEE", "#D9FFFF", "#C4E1FF", "#DDDDFF", "#FFDAC8", "#FFE4CA&quo…

开源WPF控件库-AdonisUI

原文&#xff1a;https://github.com/benruehl/adonis-ui翻译&#xff1a;沙漠尽头的狼(谷歌翻译加持)用于 WPF 应用程序的轻量级 UI 工具包&#xff0c;提供经典和增强的 Windows 视觉效果:仓库信息仓库地址&#xff1a;https://github.com/benruehl/adonis-uiDemo&#xff1a…

Unity3D脚本的生命周期(执行顺序)

Unity脚本中有许多固定的函数 例如Start();Update(); 而这些函数都有固定的执行顺序 搞清楚这些函数的执行顺序 对于我们理清代码的逻辑就显得尤为重要 举个简单的例子 //脚本A public static int a 1; void Start(){a 2; }//脚本B void Start(){Debug.Log(A.a); } 这时&…

【ArcGIS微课1000例】0023:ArcGIS将地理照片(无人机照片)转为点(航迹)案例教程

本文演示在ArcGIS中,批量将无人机航测获取的带有地理坐标的照片转为点,形成航线轨迹,并计算出三维坐标,为航测数据内业处理提供一定的基础支持。 1. 效果展示 无人机正射照片: 地理坐标转点(航迹): 2. 工具介绍 在ArcGIS中提供了批量将无人机多张照片自带的地理坐标转…

《A Seat at the Table》作者访谈录

\本文要点\\CIO&#xff08;首席信息官&#xff09;和IT领导者们必须重新定义他们的IT组织与其他企业之间的关系&#xff0c;只有这样才能利用DevOps带来的敏捷和开发周期的缩短。\\t传统的观点认为&#xff0c;IT部门是“业务”的一个独立承包商&#xff0c;这样的观点阻碍了公…

WPF效果第一百九十二篇之TreeView支持多选

前面一篇文章中玩耍了框选ListBox的效果;今天要分享基于TreeView实现节点得多选操作,最终实现的效果,如下图:1、参考项目:https://github.com/cmyksvoll/MultiSelectTreeView2、我在里面增加了一个路由事件public static readonly RoutedEvent SelectedItemsChangedEvent Even…

【BIM入门实战】Win11平台上Revit 2018_x64简体中文版图文安装与卸载完整教程

Win11平台上Revit 2018_x64简体中文版图文安装与卸载完整版教程。 【扩展阅读】:【BIM】Revit2018项目模板、族库图文安装教程 1. Revit 2018安装 断开网络连接,双击软件安装包中的Revit_2018_G1_Win_64bit_dlm_001_003.sfx.exe进行安装。 选择默认的目标文件夹,安装完成后…

[转]Xdebug----Failed loading

环境说明&#xff1a; 1、php7.2.1 2、php.ini配置 [Zend] zend_extensionD:\work-Doc\wiki\php-7.2.11-Win32-VC15-x64\ext\php_xdebug-2.6.1-7.2-vc15-x86_64.dll xdebug.remote_port9000 xdebug.remote_enable1 xdebug.remote_host127.0.0.1 xdebug.remote_handlerd…

【BIM入门实战】Revit 2018模型设计阶段重点及注意事项总结

1、最常用的三个快捷指令:对齐AL、尺寸标注DI、可见性设置VV; 2、进行新项目的创建,需要根据不同的项目类型,选择不同的样板文件,例如:创建的是建筑模型就需要选择 “建筑样板”,而结构模型就需要选择 “结构样板”,也可以选择自己设置的样板文件; 3、CAD优化处理后每…

用状态机STATE MACHINE实现有选择的文件转换

用书上的例子实现在解析HTML文本时&#xff0c;对"<>"中的符号不进行字符转换。 import sys import string from optparse import OptionParserCHAR_MAP dict(zip(string.ascii_lowercase,string.ascii_lowercase[13:26] string.ascii_lowercase[0:13]) )cla…

正式发布丨VS Code 1.69

点击上方蓝字关注我们&#xff08;本文阅读时间&#xff1a;4分钟)欢迎来到 Visual Studio Code 6月更新&#xff01;本次更新主要亮点如下&#xff1a;▌3 way merge editor在这个版本中&#xff0c;我们继续开发 3 way merge editor。可以通过将 git.mergeEditor 设置为 true…

Codeforces Round #450 (Div. 2)D. Unusual Sequences[数论][组合数学][dp II]

题目&#xff1a;http://codeforces.com/contest/900/problem/D 题意&#xff1a;找到加和为m的且gcd为n的数列种类数 分析&#xff1a;可以转化为求gcd为1的加和为m/n的种类数&#xff0c;假设有m/n个1&#xff0c;则除了第一个以外的每个1可以选择和前面一项合并&#xff0c;…

css_oneday

css css概述&#xff1a; css全称Cascading Style Sheets &#xff1a;层叠样式表&#xff0c;用于控制网页的样式和布局。 css的四种引入方式 1.行内式 行内式是在标记的style属性中设定CSS样式。这种方式没有体现出CSS的优势&#xff0c;不推荐使用。 <body><p styl…

【BIM入门实战】Revit 2018墙体绘制—别墅地下室

别墅地下室绘制效果: 设置墙体显示模式: 本文需要绘制的墙体包括:200mm外墙、200mm内墙和100mm内墙。 1. 外墙(200mm)绘制 点击【建筑】选项卡→点击【墙:结构】。 选择直线绘制工具,设置参数如下:

供应链攻击日益严重,微软开源 SBOM 生成工具 Salus

Software Package Data Exchange&#xff08;SPDX&#xff09;规范作为ISO/IEC 5962:2021发布&#xff0c;被认定为安全性、许可合规和其他软件供应链构件领域的国际开放标准。ISO/IEC JTC 1是一个独立的非政府标准机构。包括英特尔、微软、西门子、索尼、新思科技、VMware和Wi…

【BIM入门实战】建筑墙体知识全攻略

墙体是建筑重要构成部分,墙体的主要作用就是承重、围护、分割。所以,稳定、保温、隔热、隔声这些是基本要求。 一、墙体分类 1. 墙体依其在房屋所处位置的不同,有内墙、外墙、其他墙之分 (1)外墙:凡位于建筑物外界的墙称为外墙。外墙是房屋的外围护结构,起着挡风、阻雨…