`
chasewade
  • 浏览: 14301 次
  • 性别: Icon_minigender_1
  • 来自: 湖南
最近访客 更多访客>>
社区版块
存档分类
最新评论

Tomcat改端口

阅读更多
<?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">

  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />

  <!-- 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 HTTP/1.1 Connector on port 8088
    -->
    <Connector port="8088" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" 
               URIEncoding='UTF-8'
			/>
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8088" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    -->           
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the JSSE configuration, when using APR, the 
         connector should be using the OpenSSL style configuration
         described in the APR documentation -->
    <!--
    <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
               maxThreads="150" 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"/>
      -->        

      <!-- The request dumper valve dumps useful debugging information about
           the request and response data received and sent by Tomcat.
           Documentation at: /docs/config/valve.html -->
      <!--
      <Valve className="org.apache.catalina.valves.RequestDumperValve"/>
      -->

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

      <!-- Define the default virtual host
           Note: XML Schema validation will not work with Xerces 2.2.
       -->
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">

        <!-- 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 -->
        <!--
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"  
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        -->

      </Host>
    </Engine>
  </Service>
</Server>

 把默认的8080端口替换成你想要的端口

分享到:
评论

相关推荐

    tomcat部署端口后修改

    Tomcat 部署端口号修改指南 Tomcat 是一个流行的开源Web应用服务器,常用于部署Web应用程序。在实际应用中,我们可能需要修改Tomcat的端口号,以便更好地管理和维护我们的应用程序。本文将详细介绍如何修改Tomcat的...

    修改Tomcat或者 MyEclipse自带的Tomcat 的端口号

    修改Tomcat或者 MyEclipse自带的Tomcat 的端口号两种形式

    tomcat8.5(修改端口号为‘8888’)

    标题“tomcat8.5(修改端口号为‘8888’)”涉及的核心知识点是关于Apache Tomcat服务器的端口配置。Tomcat是一款广泛使用的开源Java Servlet容器,用于部署和运行Java Web应用程序。在默认情况下,Tomcat使用8080...

    如何在Windows 7中修改Tomcat的端口号.txt

    如何在Windows 7中修改Tomcat的端口号 txt 欢迎下载

    绿色版的Tomcat7.0端口已改为9090

    将Tomcat的端口改为9090,可以通过修改`conf/server.xml`文件中的`&lt;Connector&gt;`标签来实现。在`port`属性中设置为9090即可,如: ```xml connectionTimeout="20000" redirectPort="8443" /&gt; ``` 经过测试,这个...

    修改Tomcat端口为默认80端口

    3. **修改端口号**: - 将`port="8080"`中的`8080`修改为`80`,即: ```xml connectionTimeout="20000" redirectPort="8443" /&gt; ``` 4. **保存并关闭文件**: - 保存对`server.xml`文件所做的更改并关闭...

    批量更改tomcat的端口号脚本

    1、根据需要将脚本中的端口号更改 2、tomcat目录格式 tomcat-端口号

    tomcat因端口被占无法启动

    "Tomcat无法启动解决方案:端口冲突处理" Tomcat是一个流行的Java servlet容器,用于运行Java Web应用程序。但是在实际使用中,Tomcat可能会出现...通过修改Tomcat的端口号或关闭占用端口的进程,可以解决这个问题。

    修改tomcat默认端口号

    修改tomcat默认端口号

    如何修改tomcat默认端口号8080的方法

    但若在同一系统中部署了多个Tomcat实例,如果不修改端口号,它们将无法同时正常运行,因为同一端口不能被多个进程占用。因此,我们需要对Tomcat的配置文件进行修改,为每个实例分配一个唯一的端口。 2、修改方法 ...

    TOMCAT解除端口占用

    3. **修改端口占用状态**:在找到相关的服务后,可能需要查找类似于`Start`的键值,并将其值从3改为4。这里3代表的是“自动”启动模式,而4则表示“禁用”。这样做的目的是暂时禁用该服务,从而释放被占用的端口。 4...

    解决tomcat端口号被占用

    1. **修改端口设置** - 如果频繁遇到8080端口被占用的情况,可以考虑更改Tomcat的默认端口。这通常涉及到编辑Tomcat的`server.xml`配置文件。 - 打开Tomcat安装目录下的`conf`文件夹,找到`server.xml`文件并用...

    超全面javaweb教程28天第8天 6 修改tomcat端口号

    超全面javaweb教程28天第8天_6_修改tomcat端口号

    Tomcat-9.0.48配置web工程文档

    #### 三、Tomcat修改端口 **3.1 修改前访问** - **默认端口**: 8080 - **访问地址**: `http://localhost:8080/webroot/decision` **3.2 修改配置文件server.xml** - **配置文件位置**: `%tomcat%\conf\server....

    关于Tomcat的AJP端口禁用.docx

    1. **修改端口为无效值**:打开`server.xml`配置文件,将AJP Connector的port属性从8009更改为-1,这表示禁用该端口。例如: ```xml ``` 修改后,保存并重启Tomcat服务。 2. **注释掉AJP服务**:同样在`server...

    修改tomcat默认的端口号

    协同管理系统黙认使用Tomcat默认的端口8080,除8080端口外Tomcat还会占用8005,8009和8443端口。如果这4个端口已被占用,可以将协同管理系统修改为使用其它端口。 修改方法如下: 1. 如果机器上装有IIS或Apache ...

    修改tomcat端口号及同时启动多个tomat

    #### 步骤二:修改端口号 打开`server.xml`文件,查找如下代码: ```xml ``` 这里,`port="8080"`即表示当前Tomcat服务绑定的HTTP端口。根据需求,可以将其更改为任意未被占用的端口,例如`9090`: ```xml ```...

    tomcat端口占用的解决方法

    这通常涉及到修改Tomcat安装目录下的`conf/server.xml`文件中的`Connector`元素,例如将`port="8080"`改为`port="8081"`。 3. **配置防火墙规则**: 在某些情况下,可能是防火墙阻止了对端口的访问。此时,可以...

    Tomcat多端口下发布及eclipse运行调试预研

    - 修改Eclipse中的Tomcat配置,确保使用与`server.xml`中配置的相同端口。 - 重新运行项目,它将使用指定的端口(如7070)启动。 此外,了解Tomcat中HTTP和AJP的区别也很重要: - **HTTP**:这是最常用的协议,...

Global site tag (gtag.js) - Google Analytics