文档章节

tomcat多端口多路径配置

往事已成风
 往事已成风
发布于 2016/04/14 17:38
字数 840
阅读 286
收藏 0

码上生花,ECharts 作品展示赛正式启动!>>>

废话不多说,直接贴配置文件

<?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.

-->

<!-- Note:  A "Server" is not itself a "Container", so you may not

     define 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 resources

       Documentation at /docs/jndi-resources-howto.html

  -->

  <GlobalNamingResources>

    <!-- Editable user database that can also be used by

         UserDatabaseRealm 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 share

       a 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 received

         and responses are returned. Documentation at :

         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)

         Java AJP  Connector: /docs/config/ajp.html

         APR (HTTP/AJP) Connector: /docs/apr.html

         Define a non-SSL/TLS HTTP/1.1 Connector on port 8080

    -->

    

<Connector port="8080" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" />

    <!-- 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 8443

         This connector uses the NIO implementation that requires the JSSE

         style configuration. When using the APR/native implementation, the

         OpenSSL style configuration is required as described in the APR/native

         documentation -->

    <!--

    <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 processes

         every request.  The Engine implementation for Tomcat stand alone

         analyzes the HTTP headers included with the request, and passes them

         on 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 passwords

           via a brute-force attack -->

      <Realm className="org.apache.catalina.realm.LockOutRealm">

        <!-- This Realm uses the UserDatabase configured in the global JNDI

             resources under the key "UserDatabase".  Any edits

             that are performed against this UserDatabase are immediately

             available 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 applications

             Documentation at: /docs/config/valve.html -->

        <!--

        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />

        -->


        <!-- Access log processes all example.

             Documentation at: /docs/config/valve.html

             Note: 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" />


        <!-- 配置不输入项目名就可以访问项目 -->

        <Context path="/"

    docBase="D:\maven\workspace\apache-tomcat-8.0.29\webapps\eova" reloadable="true">

         </Context>


      </Host>


    </Engine>

  </Service>


  <Service name="Catalina2">

      <!-- 指定端口 -->

      <Connector port="8090" protocol="HTTP/1.1"

               connectionTimeout="20000"

               redirectPort="8443" />

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


    <Engine name="Catalina" defaultHost="localhost">

      <Realm className="org.apache.catalina.realm.LockOutRealm">

        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"

               resourceName="UserDatabase"/>

      </Realm>

      

 <!-- 指定路径 -->

 <Host name="192.168.2.61"  appBase="webapps"

            unpackWARs="true" autoDeploy="true">

        <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" />

        <!-- 

    配置图片上传路径 

    配置后图片的访问路径为:http://192.168.2.61:8090/image/bucao/xxx.png

-->

        <Context path="/image/bucao"

    docBase="D:\Codeing\static\image\bucao" 

>

         </Context>

      </Host>


    </Engine>

  </Service>

</Server>


© 著作权归作者所有

往事已成风
粉丝 1
博文 2
码字总数 1212
作品 0
深圳
程序员
私信 提问
加载中
请先登录后再评论。
Rhel Linux multipath + OpenfIler raid iscsi

前段时间学习了关于Redhat Linux上的多路径Multipath,以及为了方便学习在本机电脑上安装了Openfiler模拟存储,配置多块网卡实现多路径冗余识别存储。在这里以我个人的理解简单的描述我所认知...

Sound_
2017/06/09
0
0
[剖析] 多路径ALUA技术如何优化I/O处理

什么是ALUA多路径机制 ALUA是异步逻辑单元访问(Asymmetric Logical Unit Access)的缩写,ALUA是SPC3 (SCSI Primary commands-3)协议中规定的目标器端口组TPGS (Target Port Group Support)访...

osc_jhcv198i
2019/08/29
3
0
iscsi挂载和多路径——实战篇

第一部分 硬件 服务器:超威(SUPERMICRO)刀片机一刀(内存8G、硬盘2T) 存储:主控:双控制器IPSAN(每个控制器4个网口,最左侧1个管理口),容量64T。扩展柜:容量64T 系统 服务器:centos6...

changelf
2018/12/28
0
0
Synology NAS 存储系统多路径连接Vmware ESXi 6.5

背景介绍 公司之前用的存储是Nimble Storage,上面大概有25T左右的空间都是历史的归档文件服务器,平常访问不多,又占据空间,为了节约空间,我们打算弄个低端的NAS存储,把这些不怎么用的服...

beanxyz
2018/06/29
0
0
Linux存储在线管理(一)FC磁盘设备管理

转自EMC中文支持论坛 – https://community.emc.com/go/chinese 介绍 本文主要介绍Linux环境下FC磁盘管理相关只是,主要内容包括FC驱动介绍、Linux SCSI磁盘永久命名、FC磁盘添加与删除、FC磁...

476069017
2017/04/21
0
0

没有更多内容

加载失败,请刷新页面

加载更多

C# 扩展TaskScheduler实现独立线程池,支持多任务批量处理,互不干扰,无缝兼容Task

为什么编写TaskSchedulerEx类? 因为.NET默认线程池只有一个线程池,如果某个批量任务一直占着大量线程,甚至耗尽默认线程池,则会严重影响应用程序域中其它任务或批量任务的性能。 特点: ...

osc_yizwdm15
昨天
5
0
PowerMock使用详解

1. PowerMock是什么? PowerMock是一个Java模拟框架,用于解决测试问题。 举个例子,你在使用Junit进行单元测试时,并不想让测试数据进入数据库,怎么办?这个时候就可以使用PowerMock,拦截...

osc_jpwyxabk
昨天
15
0
【C语言期末实训】学生学籍管理系统

目录:一,设计要求1,总体要求:2,具体功能:二,设计框架三,程序代码1,声明函数和头文件2,声明结构体3,声明全局变量4,主体启动函数5,主菜单...

osc_2g1pfwhe
昨天
8
0
使用Celery遇到的坑

通过Celery操作云通讯,发送短信验证码报错{'172001':'网络错误'}针对Windows系统,Mac系统不晓得 1、检查是否取消全局证书验证 import ssl# 全局取消证书验证ssl._create_default_http...

osc_7dwwmolq
昨天
5
0
使用Celery遇到的坑

通过Celery操作云通讯,发送短信验证码报错{'172001':'网络错误'}针对Windows系统,Mac系统不晓得 1、检查是否取消全局证书验证 import ssl# 全局取消证书验证ssl._create_default_http...

osc_lhwd57ou
昨天
19
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部