`
vincent_com
  • 浏览: 42019 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类

配置Tomcat域名、项目映射

 
阅读更多
小问题出大错误,总有人在小地方摔跤。
下面是好几位同学问的同学的问题。

配置的主要 节点

    <Host name="www.abc.cn"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Alias>www.abc.cn</Alias>
<Context path="" docBase="abc" debug="0" reloadable="true"/>
</Host>
  <Host name="www.def.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
<Alias>www.def.com</Alias>
<Context path="" docBase="def" debug="0" reloadable="true"/>
</Host>



<?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 8080
    -->
    <Connector port="80" protocol="HTTP/1.1" 
               connectionTimeout="20000" 
               redirectPort="8443" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="80" 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>
	  	  <Host name="www.abc.cn"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
			<Alias>www.abc.cn</Alias>
			<Context path="" docBase="abc" debug="0" reloadable="true"/> 
	 </Host>
	  <Host name="www.def.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
			<Alias>www.def.com</Alias>
			<Context path="" docBase="def" debug="0" reloadable="true"/> 
	 </Host>
    </Engine>
  </Service>
</Server>

分享到:
评论

相关推荐

    tomcat 多域名配置

    基于同一ip,多个域名 tomcat 配置

    tomcat配置多域名

    文档中详细描述在一个tomcat下如何进行多域名的配置与映射,可以实现在一台服务器上存放多个域名的网站。

    tomcat server.xml 配置

    现在很多的公司的网站都是用tomcat作为应用服务区...并且这些域名是如何对应不同的项目呢?而且我的服务器没放在机房,放在我的本地,我应该如何把我的服务器给映射到外网?这一系列的问题,今天就这个问题,我来说一下

    jakarta-tomcat-connectors-jk2.0.4-win32-IIS.zip

    进入主目录选项卡,在弹出窗口中选择添加,这里对 jsp 文件和 struts 的 do 访问方式进行映射配置,点击添加铵钮, 可执行文件选择 TOMCAT_HOME/iis/isapi_redirector2.dll ,扩展名为 jsp ,同样对 do 也进行...

    详解实现Nginx+Tomcat实现单IP、多域名、多站点的访问

    小到两个网站只能跑在一台512M内存的公网服务器上(tomcat+MySQL,由于内存太小了,只能把两个网站部署在同一个tomcat上),每个网站有自己的域名,初步考虑使有nginx做反向代理,把两个域名映射到相应的应用上。...

    对一个tomcat实现多端口、多域名访问的方法

    2、进行步骤1中的配置,多端口就完成了,保存并启动tomcat。 使用8080端口访问的效果图: 3、使用9090端口访问的效果图: 这样,就实现了不同的端口号访问到同一个应用程序了。如果还想在其他端口进行监听,就把...

    geoserver与OpenLayers配置入门

    5.4.1.1 将域名映射到本地 21 5.4.2 编辑html 22 5.4.3 查看效果 22 6 GEOSERVER高级设置 23 6.1 自定义图层的STYLE 23 6.2 查看图层的字段信息 26 6.3 在TOMCAT上部署GEOSERVER 27 6.4 自定义名称空间 28 7 参考...

    外网访问内网服务器.docx

    映射配置的方法: 内网地址:内网网站主机地址 内网端口:内网网站端口号 外网端口:不用管,它自动分配一个的 外网地址:可以用自己的域名,也可以直接用提示的二级域名(鼠标放在输入框上有提示地址格式) 映射保存...

    通过nginx代理拦截请求进行全局访问限制

    本文介绍了通过nginx代理拦截请求进行全局访问限制,分享给大家,具体如下: 运行环境: Ubantu 14.0  ...虚拟目录来映射文件的位置,或者说跨域夸项目;如果没有对这些进行一个访问的权限的限制,那

    网络通 java版下载(支持linux,os x,需先安装java运行环境)与安装方法

    网络通是免费的内网端口映射软件,可轻松访问连接内网,100%穿透内网,不需设置路由器,不需公网ip,不需固定ip,不需动态域名,用户可免费添加多个映射,适合在公司,小区宽带,出租屋,校园网,网吧,教育网,等网络...

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

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

    centos7.5分布式平台搭建.docx

    8.1. 配置tomcat的环境变量和内存设置 29 8.2. 服务自启动 30 9. Mysql 30 9.1. 离线安装 30 9.2. 在线安装 30 9.2.1. 检测系统是否自带安装mysql 30 9.2.2. 下载yum包 30 9.2.3. 安装mysql 30 9.2.4. 启动服务 30 ...

    接着读完它,linux基础不会?都难!!!

    Linux的权限命令文件权限Linux三种文件类型文件类型标识文件权限管理Linux上常用网络操作主机名配置IP地址配置域名映射网络服务管理三. linux上软件安装在Linux上安装JDK在Linux上安装Mysql在Linux上安装tomcat ...

    基于J2EE框架的个人博客系统项目毕业设计论文(源码和论文)

    管理员进入登录后,可对帐户进行管理,包括添加管理员帐户、修改管理员帐户、删除管理员帐户和对帐户进行权限设置。 博客用户通过前台登录后,可对自己的博客空间进行管理,包括发布自己的网络日志、收藏个人图片...

    低清版 大型门户网站是这样炼成的.pdf

    4.2.4 hibernate的映射配置文件 201 4.2.5 体验hibernate(会员管理) 203 4.3 hibernate的映射机制 212 4.3.1 hibernate的基本映射数据类型 212 4.3.2 hibernate的主键映射 218 4.3.3 hibernate的实体映射 228...

    java面试题库2021.pdf

    ①IoC 与 Bean 配置、 管理 ②AOP 与事务、 权限控制 ③S2SH 整合开发 ④Spring, JPA 整合 2、 Hibernate ①ORM 与持久化映射 ②延迟加载、 性能优化 ③HQL 查询、 条件查询、 SQL 查询 ④二级缓存与查询缓存 3、 ...

    详解NGINX访问https跳转到http的解决方法

    网站架构:用户–https—&gt;nginx代理—http—-&gt;tomcat/nginx+php nginx待遇发给后端的请求是http协议,后端程序跳转获取到的协议是http,返回一个redirect(http header中带Location://www.jb51.net/aaa.html),...

    JAVA 范例大全 光盘 资源

    实例196 Tomcat连接池的配置 629 实例197 MySQL数据库的分页形式 633 实例198 连接ODBC数据库的Apple程序 640 第20章 JSP/Servlet技术 644 实例199 JSP与Servlet之间的跳转 644 实例200 简单的JSP多人聊天室 ...

    Java开发技术大全 电子版

    14.2.2用Eclipse创建一个项目440 14.3AWT组件简介444 14.3.1AWT组件的层次结构445 14.3.2AWT中的基本组件和子包446 14.3.3AWT组件通用属性与方法448 14.3.4使用AWT编制GUI程序示例449 14.4事件处理452 14.4.1...

    Java开发技术大全(500个源代码).

    demoPri.java 调用上面这个类设置线程优先级示例 myThread.java 自己定义的一个Thread的子类 mutexThread.java 一个能管理临界区的线程类 demoMutex.java 使用上面这个类来演示线程的互斥 commSource.java 一个...

Global site tag (gtag.js) - Google Analytics