可能是因为resin4出来不久的原因,很多人对一个resin配置多个app不是很了解,经过几个小时的研究,有了一些小的成果,在此分享一下:

在开发的时候很多人习惯了一个resin下配置多个app,习惯了resin3的配置方式,所以resin4出来后就不懂如何配置了。

根据我的理解,配置多个app分为两种情况(此处指一个resin的情况下):

一.同一个域名下多个子app,根据url层级来指向,例如:

http://www.test.com与http://www.test.com/demo/

二.多个域名对应指定的host,根据域名来指向,例如:

http://www.test1.com与http://www.test2.com

第一种的配置方法:

<cluster id="app">
    <!-- define the servers in the cluster -->
    <server-multi id-prefix="app-" address-list="${app_servers}" port="6801"/>

<host-default>
      <!-- creates the webapps directory for .war expansion -->
      <web-app-deploy path="webapps"
                      expand-preserve-fileset="WEB-INF/work/**"
                      multiversion-routing="${webapp_multiversion_routing}"
                      path-suffix="${elastic_webapp?resin.id:''}"/>
    </host-default>

<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

<!-- the default host, matching any host name -->
    <host id="" root-directory=".">
      <!--
         - webapps can be overridden/extended in the resin.xml
        -->
      <web-app id="/" root-directory="webapps/ROOT"/>
      <web-app id="/demo" root-directory="webapps/demo"/>
    </host>

</cluster>

第二种的配置方法: 
<cluster id="app">
    <!-- define the servers in the cluster -->
    <server-multi id-prefix="app-" address-list="${app_servers}" port="6801"/>

<host-default>
      <!-- creates the webapps directory for .war expansion -->
      <web-app-deploy path="webapps"
                      expand-preserve-fileset="WEB-INF/work/**"
                      multiversion-routing="${webapp_multiversion_routing}"
                      path-suffix="${elastic_webapp?resin.id:''}"/>
    </host-default>

<!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

<!--每个host id下也可以包含多个web-app,参考第一种的配置方法-->
    <host id="www.test1.com" root-directory=".">
      <web-app id="/" root-directory="webapps/test1/ROOT"/>
    </host>

<host id="www.test2.com" root-directory=".">
      <web-app id="/" root-directory="webapps/test2/ROOT"/>
    </host>

</cluster>

最新文章

  1. 安卓与IOS移动段浏览器视频与音频的问题与总结
  2. CLIQUE 聚类算法以及Java实现+多线程
  3. uboot引导linux内核过程详解【转】
  4. svn介绍和安装
  5. Linux系统下配置网络、JAVA环境,配置tomcat,mysql
  6. [转]XModem协议
  7. Spring发送邮件
  8. 配置中心Nacos
  9. Nginx反向代理400错误
  10. Apache Storm Installation
  11. JXNU暑期选拔赛
  12. poj-3177(并查集+双联通分量+Tarjan算法)
  13. java从字符串中提取数字
  14. Linux其他:环境变量配置
  15. C++for的几种方式
  16. oracle查看处理过程
  17. django drf 改变retrive的pk查询字段
  18. c#静态扩展方法,字典的克隆扩展方法
  19. React组件生命周期小结
  20. c++的set_unexpected不起作用

热门文章

  1. python深拷贝,浅拷贝
  2. docker swarm 集群及可视化界面的安装及配置
  3. cpu资源长期使用率过高导致系统内核锁问题
  4. CHD 5.15 安装 Kylin
  5. List接口特有功能
  6. linux相关命令整理
  7. 阿里云 ss!!!
  8. java第四章接口
  9. Python CGI编程
  10. 网络通信实验(2)TCP/IP LWIP 简介