`

tomcat绑定二级域名 配置

    博客分类:
  • java
 
阅读更多
二级域名已经映射服务器IP 的情况下  server.xml如下:

<?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="8006" 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" />
  <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
  <Listener className="org.apache.catalina.core.JasperListener" />
  <!-- 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 HTTP/1.1 Connector on port 8080
    -->
    <Connector port="8088" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <!--这里的8088端口改为80端口 -->
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    -->
    <!-- Define a SSL HTTP/1.1 Connector on port 8443
         This connector uses the BIO 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.Http11Protocol"
               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="http://wechat.lzcourt.gov.cn/">

      <!--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="http://wechat.lzcourt.gov.cn/"  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 docBase="luzhou_weiWeb" path="" reloadable="true"/></Host></Host>
    </Engine>
  </Service>
</Server>



分享到:
评论

相关推荐

    使用域名绑定tomcat

    在IT行业中,域名绑定是一个常见的任务,特别是在搭建Web服务器时,比如Tomcat。Tomcat是Apache软件基金会的一个开源项目,它是一个轻量级的应用服务器,主要用于处理Java Servlet和JavaServer Pages(JSP)。当我们...

    tomcat域名绑定[归类].pdf

    ### Tomcat5.5配置详解:多域名绑定与虚拟目录设置 #### 一、多域名绑定配置 在本文档中,我们将详细介绍如何在Tomcat5.5中进行多域名绑定和虚拟目录的设置。这对于搭建多站点服务器尤其有用,使得单个Tomcat实例...

    [主机域名]老枪二级域名系统朴素版_lqdomain.rar

    在二级域名系统中,需要配置DNS服务器,设置CNAME记录或者其他类型的记录,以实现二级域名到主域名的映射。同时,还需要理解HTTP协议,它是Web通信的基础,用于传输网页数据。 三、JAVA 虽然标题中提到了JAVA,但在...

    网市场云建站系统v3.5,在线开通网站,自动分配二级域名

    网市场云建站系统,在线开通网站,自动分配二级域名、或绑定顶级域名。全程无需操作代码及服务器。使用各种云产品,将一个网站成本降低到1块钱!打破传统建站的高成本,让每个人都能有自己的网站! 功能简介: 1....

    详解Tomcat多域名配置(多个项目共用80端口)

    今天在做项目时,需要用已申请好的三个二级域名(公司不可能每个项目都申请一个顶级域名,所以这里解析的三个二级域名),分别配置到三个项目,网上搜了一堆,感觉看的不明不白,故在此记录下。 总体步骤是:申请...

    tomcat server.xml 配置

    通过上述分析可知,`server.xml`配置文件是Tomcat运行的基础,通过对其中各元素的合理配置,不仅可以满足基本的应用部署需求,还能实现更为复杂的场景,如多域名绑定、项目映射等。掌握这些配置技巧,能够帮助开发者...

    ubuntu配置多个tomcat方法

    ### Ubuntu配置多个Tomcat的方法详解 #### 一、前言 在Linux环境下,特别是Ubuntu操作系统中,...当然,在实际操作过程中还可能遇到其他问题,例如防火墙规则配置、域名绑定等,这些都需要根据具体情况进一步解决。

    tomcat7.0.rar

    在Windows系统下,解压"tomcat7.0.rar"文件后,可以通过修改conf/server.xml配置文件来设置端口号、上下文路径等。同时,通过bin目录下的startup.bat和shutdown.bat脚本来启动和关闭Tomcat服务。在Linux环境下,可...

    tomcat源码基于6.0

    5. **Naming**:Tomcat提供了JNDI(Java Naming and Directory Interface)服务,使得应用可以查找和绑定资源。 二、Tomcat源码分析 1. **启动流程**:从`bin/catalina.sh`或`bin/catalina.bat`开始,通过`org....

    tomcat目录结构详解

    - **server.xml**:服务器配置文件,用于设置端口号、域名/IP绑定、默认加载的Web应用等。 - **web.xml**:Web应用配置文件,定义了Tomcat支持的文件类型、错误页面等全局设置。 - **context.xml**:环境配置文件...

    2021-2022计算机二级等级考试试题及答案No.3640.docx

    这些题目涵盖了计算机二级等级考试中的多个知识点,包括网络配置、数据库管理、编程语言、数据结构和数据库操作、网页设计与开发、操作系统原理等。以下是这些题目涉及的知识点详解: 1. 虚拟目录:在Web服务器中,...

    2021-2022计算机二级等级考试试题及答案No.1761.docx

    ### 计算机二级等级考试知识点解析 #### 1. HTML页面中JavaScript的插入位置 - **知识点**:HTML文档的结构与JavaScript的插入位置 - **解析**:在HTML文档中,`&lt;body&gt;` 和 `&lt;head&gt;` 部分都可以插入JavaScript代码...

    Cas使用StartSSL证书实现统一认证服务.pdf

    在输入要绑定的二级域名,并提交申请后,需要等待StartSSL的审核。审核通过后,通过ToolBox工具可以下载到证书文件,即.crt文件。 接着,需要将StartSSL下载的证书文件部署到Apache服务器。这包括ssl.crt、ssl.key...

    java项目上线

    绑定完IP和端口号后,接下来需要在花生壳管理平台中编辑一个应用,这通常涉及到填写相关域名信息、端口信息以及其他可能需要的配置。 四、启动MyEclipse项目并进行访问 完成上述配置后,就可以在MyEclipse中启动...

    Eclipse开发分布式商城系统+完整视频代码及文档

    通过域名配置虚拟机.avi │ 淘淘商城第二天笔记.docx │ ├─03.第三天 │ 01.课程回顾.avi │ 02.课程计划.avi │ 03.什么是反向代理.avi │ 04.nginx的反向代理及负载均衡.avi │ 05.FastDFS介绍.avi │ 06....

    nginx window 版本

    2. **虚拟主机**: 通过`server`块,Nginx支持配置多个虚拟主机,每个`server`块可以绑定不同的域名或IP,提供不同的网站服务。 3. **静态文件服务**: Nginx擅长处理静态文件请求,如HTML、CSS、JavaScript等。通过`...

    《Jetty6_指南书》

    - **域名绑定**: 如何配置域名绑定,实现多个网站的访问。 #### 十、管理服务器 - **服务器日志管理**: 如何配置日志记录,以便于故障排查。 - **实时状态监控**: 实现对服务器运行状态的实时监控。 - **关闭服务器...

Global site tag (gtag.js) - Google Analytics