`
zhengchao860730
  • 浏览: 61364 次
  • 性别: Icon_minigender_1
  • 来自: 福州
社区版块
存档分类
最新评论

Resin3.0 配置信息 resin.conf

 
阅读更多
<!--
   - Resin 3.1 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">

  <!-- 添加的所有JAR文件。在/ lib目录 -->
  <class-loader>
    <tree-loader path="${resin.home}/ext-lib"/>
    <tree-loader path="${resin.root}/ext-lib"/>

    <tree-loader path="${resin.home}/lib"/>
    <tree-loader path="${resin.root}/lib"/>
  </class-loader>

  <!--
     - 管理配置
     -
     - 远程管理至少需要一个使管理员.
    -->
  <management path="${resin.root}/admin">
    <user name="admin" password="password" disable="true"/>

    <resin:if test="${resin.professional}">
      <deploy-service/>
      <jmx-service/>
      <log-service/>
      <xa-log-service/>
    </resin:if>
  </management>

  <!--
     - 日志配置JDK日志API.
    -->
  <log name="" level="info" path="stdout:"
       timestamp="[%H:%M:%S.%s] {%{thread}} "/>

  <!--
     - “信息”的生产
     - 'fine' or 'finer' 帮助故障排除
    -->
  <logger name="com.caucho" level="info"/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!-- 为生产基地,检查是否发生改变的间隔时间600秒,所以它只检查每10分钟更新一次 -->
  <dependency-check-interval>2s</dependency-check-interval>

  <!--
     - SMTP服务器发送邮件通知 配置
    -->
  <system-property mail.smtp.host="127.0.0.1"/>
  <system-property mail.smtp.port="6125"/>

  <!--
     - 设置字符集编码,默认是utf-8
     -
     - <character-encoding>utf-8</character-encoding>
    -->

  <!--
     - 可以更改编译器 javac  
    -->
  <javac compiler="internal" args="-source 1.5"/>

  <!-- 安全服务提供商.
     - <security-provider>
     -    com.sun.net.ssl.internal.ssl.Provider
     - </security-provider>
    -->

  <!-- 取消对resin的XML实现
     -
     - <system-property javax.xml.parsers.DocumentBuilderFactory
     -                 ="com.caucho.xml.parsers.XmlDocumentBuilderFactory"/>
     - <system-property javax.xml.parsers.SAXParserFactory
     -                 ="com.caucho.xml.parsers.XmlSAXParserFactory"/>
    -->

  <cluster id="app-tier">
    <!-- 设置根目录 -->
    <root-directory>.</root-directory>

    <server-default>
      <!--  http服务  端口  -->
      <http address="*" port="6661"/>

      <!--
         - SSL 协议端口配置相关
         -
         - <http address="*" port="6441">
         -   <openssl>
         -     <certificate-file>keys/gryffindor.crt</certificate-file>
         -     <certificate-key-file>keys/gryffindor.key</certificate-key-file>
         -     <password>test123</password>
         -   </openssl>
         - </http>
        -->

      <!-- JVM参数 -->
      <jvm-arg>-Xmx256m</jvm-arg>
      <jvm-arg>-Xss1m</jvm-arg>
      <jvm-arg>-Xdebug</jvm-arg>
      <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>

      <!--
         - 取消管理员堆转储
         - <jvm-arg>-agentlib:resin</jvm-arg>
        -->

      <!-- 线程监控看门狗程序  -->
      <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>
      <watchdog-port>6600</watchdog-port>

      <!-- 强制 resin 强制重起时的最小空闲内存 -->
      <memory-free-min>1M</memory-free-min>

      <!-- 最大线程数  -->
      <thread-max>256</thread-max>

      <!-- 配置socket连接超时时间 -->
      <socket-timeout>65s</socket-timeout>

      <!-- 配置 keepalive -->
      <keepalive-max>128</keepalive-max>
      <keepalive-timeout>15s</keepalive-timeout>

      <!--
         -  resin 作为根在UNIX系统中,为Web服务器的用户指定用户名和组名
         -
         - <user-name>resin</user-name>
         - <group-name>resin</group-name>
        -->
    </server-default>

    <!-- 集群中的服务器定义 -->
    <server id="" address="127.0.0.1" port="6800"/>

    <!-- 在单服务器或群集配置中的持久性存储 -->
    <resin:if test="${resin.professional}">
      <persistent-store type="cluster">
        <init path="session"/>
      </persistent-store>
    </resin:if>

    <!--
       - 为了安全,使用不同的SSL会话cookie。
       - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
      -->

    <!-- 开启缓存 (available in Resin Professional)  -->
    <resin:if test="${resin.professional}">
      <cache path="cache" memory-size="64M">
        <!-- Vary header rewriting for IE -->
        <rewrite-vary-as-private/>
      </cache>
    </resin:if>

    <!-- 定期检查死锁的服务器状态 所有服务加入<url> 都要被检查  -->
    <resin:if test="${resin.professional}">
      <ping>
        <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
      </ping>
    </resin:if>

    <!-- 违约适用于每个Web应用程序。 -->
    <web-app-default>
      <prologue>
        <!--
           - Extension library for common jar files.  The ext is safe
           - even for non-classloader aware jars.  The loaded classes
           - will be loaded separately for each web-app, i.e. the class
           - itself will be distinct.
          -->
        <class-loader>
          <tree-loader path="${resin.root}/ext-webapp-lib"/>
        </class-loader>

        <!-- Servlet和过滤器初始化参数可以使用EL表达式 -->
        <allow-servlet-el/>
      </prologue>
      
      <!-- 对于可缓存的页面设置缓存超时值,例如静态页面-->
      <cache-mapping url-pattern="/" expires="5s"/>
      <cache-mapping url-pattern="*.gif" expires="60s"/>
      <cache-mapping url-pattern="*.jpg" expires="60s"/>
      <cache-mapping url-pattern="*.png" expires="60s"/>

      <!-- 为了安全,默认情况下禁用会话的URL -->
      <session-config>
        <enable-url-rewriting>false</enable-url-rewriting>
      </session-config>

      <!-- 为了安全,在cookie设置httponly旗
         - <cookie-http-only/>
        -->

      <!-- 一些JSP包有不正确的 .tld files. 设置验证标签库模式假绕过这些包是可能的.  -->
        <jsp>
          <validate-taglib-schema>true</validate-taglib-schema>
          <fast-jstl>true</fast-jstl>
        </jsp>
    </web-app-default>

    <!-- 指向引入默认的Web应用程序 配置文件 -->
    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!--
       - Sample database pool configuration
       -
       - The JDBC name is java:comp/env/jdbc/test
         <database>
           <jndi-name>jdbc/mysql</jndi-name>
           <driver type="org.gjt.mm.mysql.Driver">
             <url>jdbc:mysql://localhost:3306/test</url>
             <user></user>
             <password></password>
            </driver>
            <prepared-statement-cache-size>8</prepared-statement-cache-size>
            <max-connections>20</max-connections>
            <max-idle-time>30s</max-idle-time>
          </database>
      -->

    <!-- 默认的主机配置,适用于所有的虚拟主机。 -->
    <host-default>
      <!-- 与另一个Web服务器,如Apache, 这可以说是因为Web服务器将日志信息.  -->
      <access-log path="logs/access.log" 
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1W"/>

      <!-- 创建的webapps目录 -->
      <web-app-deploy path="webapps"/>

      <!-- 创建部署目录 -->
      <ear-deploy path="deploy">
        <ear-default>
          <ejb-server>
            <config-directory>WEB-INF</config-directory>
          </ejb-server>
        </ear-default>
      </ear-deploy>

      <!-- 创建部署目录RAR扩充。 -->
      <resource-deploy path="deploy"/>
    </host-default>

    <!-- 配置虚拟主机部署目录 -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <!-- 配置默认的主机,任何主机名匹配 -->
    <host id="" root-directory=".">
      <!-- 配置一个明确的根Web应用程序相匹配的webapp的根 -->
      <web-app id="/" root-directory="webapps/ROOT"/>

      <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">
        <!--
           - Administration application /resin-admin
          -->
        <prologue>
          <resin:set var="resin_admin_external" value="false"/>
          <resin:set var="resin_admin_insecure" value="true"/>
        </prologue>
      </web-app>
    </host>
  </cluster>

  <!-- 配置Web层/负载平衡器 -->
  <resin:if test="${resin.professional}">
    <cluster id="web-tier">
      <server-default>
        <!-- The http port -->
        <http address="*" port="9080"/>
      </server-default>

      <server id="web-a" address="127.0.0.1" port="6700"/>

      <cache path="cache" memory-size="64M"/>

      <host id="">
        <web-app id="/">

           <rewrite-dispatch>
             <load-balance regexp="" cluster="app-tier"/>
           </rewrite-dispatch>

        </web-app>
      </host>
    </cluster>
  </resin:if>
  <cluster id="wpa">
                <server id="wpa" address="127.0.0.1" port="6803">
               </server>

                <host id="wpa.17173.com" root-directory="/home/songchen/WebPageAnalytics">
               </host>

        </cluster>

</resin>

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics