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>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章