同台服务器 部署多个tomcat 需要做的修改

需要修改以下加粗部分:

  1:访问端口 8080->8081

  2:shutdown 端口 8005->8015

  3: AJP端口 8001->8010

<?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="8015" 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="8081" protocol="HTTP/1.1" maxThreads="200"
               minSpareThreads="25"
               maxSpareThreads="100"
               acceptCount="200"
               connectionTimeout="20000"
               enableLookups="false"
               disableUploadTimeout="true"
               compression="on"
               compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,text/json,application/x-javascript,application/javascript,application/json"
               redirectPort="8443" URIEncoding="UTF-8"/>
    <!-- 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="8010" 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="access" suffix=".log"
               pattern="%h %l %u %t &quot;%r&quot; %s %b %D %T %F" />

      </Host>
    </Engine>
  </Service>
</Server>
时间: 2024-10-06 23:44:36

同台服务器 部署多个tomcat 需要做的修改的相关文章

同一服务器部署多个tomcat时的端口号修改详情

同一服务器部署多个tomcat时,存在端口号冲突的问题,所以需要修改tomcat配置文件server.xml,以tomcat7为例. 首先了解下tomcat的几个主要端口: <Connector port="8080" protocol="HTTP/1.1"  connectionTimeout="60000"  redirectPort="8443" disableUploadTimeout="false&q

(转)同一服务器部署多个tomcat时的端口号修改详情

背景:在同一个服务器上部署工程,总会遇到tomcat端口占用的情况,所有有必要分清楚各个端口的作用,和需要更改的端口. 同一服务器部署多个tomcat时,存在端口号冲突的问题,所以需要修改tomcat配置文件server.xml,以tomcat7为例. 主要的几个端口 首先了解下tomcat的几个主要端口: <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="60000"

一台服务器部署多台tomcat

如题,多个项目部署在一台服务器.减少容错性,觉得分开部署,这样一个tomcat挂了不会影响另一个项目.看配置和应用大小决定数量,一般四五个没问题,也有单台服务器部署8个tomcat稳定运行的. 下面记录方法 1. 修改/etc/profile文件 需要在文件中添加多组CATALINA环境变量(有几个tomcat就添加几组)后面的地址为tomcat实际安装的地址. ####第一个Tomcat####export CATALINA_BASE=/usr/local/tomcat/apache-tomc

同一服务器部署多个Tomcat时端口修改

同一服务器部署多个Tomcat时,存在端口冲突问题,需要修改Tomcat配置文件server.xml,以tomcat7为例. 部署多个tomcat主要修改三个端口: (1)http端口,默认8080,现修改为9080 <Connector port="9080" protocol="HTTP/1.1" connectionTimeout="60000" redirectPort="8443" disableUploadT

同台电脑部署多组Tomcat负载均衡(或集群)

可能这种需求比较少见,不过如果手上服务器不够用.可以考虑先这么干着.. 具体Tomcat怎么搭集群,就不在这细说了.只写同台电脑部署多组集群需要修改和注意的地方. 一.Apache 先是Apache,同一台电脑装多台Apache需要把原来的复制一份. 修改conf/httpd.conf 1.文件中会有一些Apache的路径,需要全部替换成新位置 2.端口号需要改 然后添加服务:管理员权限打开cmd切换到新Apache目录下面执行:httpd -k install -n Apache2.2_2 二

一个tomcat下部署多个项目或一个服务器部署多个tomcat

最近需要把两个项目同时部署到服务器上,于是研究了一下,页借鉴了很多别人的方法,把过程记录下来,以儆效尤. 目录: 1,一个tomcat下同时部署两个项目(多个项目可以参考) 1.1项目都放在webapps内(共用一个端口) 1)把两个项目都放在webapps下. 2)处理重复jar包. 3)tomcat端口默认为8080.如果想修改可以去conf下的server.xml中进行修改 4)启动tomcat 1.2建立多个类似于webapps的文件夹,通过conf下的server.xml进行配置(每个

Window下同一台服务器部署多个tomcat服务

本文使用tomcat 8.0压缩版进行部署. 工具 apache-tomcat-8.0.30 安装tomcat步骤 1. 下载apache-tomcat-8.0.30 ,下载下来的文件为apache-tomcat-8.0.30-windows-x64.zip 2. 解压该压缩包到D:/目录下. 3. 修改解压文件夹名字为:tomcat-8080 4. 在D:/目录下创建该文件夹的两个副本,分别更名为:tomcat-8081.tomcat-8082 5. 添加环境变量:右键单击我的电脑->选择属性

服务器部署多个tomcat经验

如果想在服务器上部署两个或多个tomcat项目,可以采用多个端口的方法: 如何修改Tomcat端口?   答:在Tomcat的conf文件夹里有个server.xml文件,修改里面的<Connector port="80"               maxHttpHeaderSize="8192"               maxThreads="150" minSpareThreads="25" maxSpareT

Linux服务器部署系列之八—Sendmail篇

Sendmail是目前Linux系统下面用得最广的邮件系统之一,虽然它存在一些不足,不过,目前还是有不少公司在使用它.对它的学习,也能让我们更深的了解邮件系统的运作.下面我们就来看看sendmail邮件服务器的部署. 本文将从以下几个方面讲解Sendmail邮件系统: 1.Sendmail安装: 2.Sendmail基本配置: 3.Openwebmail安装和配置: 4.配置Mailscanner+clamav过滤病毒: 5.配置SpamAssassin+mimedefang过滤垃圾邮件. 本文