resin 配置說明

關鍵字: resin conf
xml 代碼
 
  1. <!--  Resin 3.1 配置文件. -->  
  2. <resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core">  
  3.   <!-- 加載resin/lib下的所有.jar文件-->  
  4.   <class-loader>  
  5.     <tree-loader path="${resin.home}/lib"/>  
  6.     <tree-loader path="${resin.root}/lib"/>  
  7.   </class-loader>  
  8.   <!--  管理配置 -->  
  9.   <management path="${resin.root}/admin">  
  10.   </management>  
  11.   <!--   JDK日誌接口的配置.   -->  
  12.   <log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>  
  13.   <!-- 日誌信息的級別:'info' 生產環境  'fine' 開發環境 'finer' 調試環境 -->  
  14.   <logger name="com.caucho" level="info"/>  
  15.   <logger name="com.caucho.java" level="config"/>  
  16.   <logger name="com.caucho.loader" level="config"/>  
  17.   <!--  環境上下文的檢測時間,對於生產站點, 這個要設置長一點,例如600秒,10分鐘  -->  
  18.   <dependency-check-interval>2s</dependency-check-interval>  
  19.   <!--      發送郵件通知的SMTP服務器     -->  
  20.   <system-property mail.smtp.host="127.0.0.1"/>  
  21.   <system-property mail.smtp.port="25"/>  
  22.   <!--      你可以把編譯器改成 "javac", "eclipse" 或者 "internal".    -->  
  23.   <javac compiler="internal" args="-source 1.5"/>  
  24.   
  25.   <!-- Security providers. -->  
  26.       <security-provider>  
  27.          com.sun.net.ssl.internal.ssl.Provider  
  28.       </security-provider>  
  29.   
  30.   <!-- 去掉註釋,如果你使用resin提供的xml應用 -->  
  31.         
  32.       <system-property javax.xml.parsers.DocumentBuilderFactory  
  33.                       ="com.caucho.xml.parsers.XmlDocumentBuilderFactory"/>  
  34.       <system-property javax.xml.parsers.SAXParserFactory  
  35.                       ="com.caucho.xml.parsers.XmlSAXParserFactory"/>  
  36.     
  37.   <cluster id="app-tier">  
  38.     <!-- 設置集羣上下文的根, 相對於server.root -->  
  39.     <root-directory>.</root-directory>  
  40.     <server-default>  
  41.       <!-- HTTP服務的端口-->  
  42.       <http address="*" port="8080"/>  
  43.       <!-- SSL端口配置: -->  
  44.             
  45.           <http address="*" port="8443">  
  46.             <openssl>  
  47.               <certificate-file>keys/gryffindor.crt</certificate-file>  
  48.               <certificate-key-file>keys/gryffindor.key</certificate-key-file>  
  49.               <password>test123</password>  
  50.             </openssl>  
  51.           </http>  
  52.          
  53.       <!--          JVM參數設置        -->  
  54.       <jvm-arg>-Xmx256m</jvm-arg>  
  55.       <jvm-arg>-Xss1m</jvm-arg>  
  56.       <jvm-arg>-Xdebug</jvm-arg>  
  57.       <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>  
  58.       <!-- Uncomment to enable admin heap dumps 去掉這個如果你想管理內存堆的傾倒 -->  
  59.           <jvm-arg>-agentlib:resin</jvm-arg>  
  60.   
  61.       <watchdog-arg>-Dcom.sun.management.jmxremote</watchdog-arg>  
  62.       <!--   強制resin強制重起時的最小空閒內存    -->  
  63.       <memory-free-min>1M</memory-free-min>  
  64.       <!-- 最大線程數量. -->  
  65.       <thread-max>256</thread-max>  
  66.       <!--  套接字等待時間 -->  
  67.       <socket-timeout>65s</socket-timeout>  
  68.       <!-- 配置 keepalive -->  
  69.       <keepalive-max>128</keepalive-max>  
  70.       <keepalive-timeout>15s</keepalive-timeout>  
  71.       <!--          如果使用的是UNIX,這裏是啓動的帳號和用戶組. -->  
  72.           <user-name>resin</user-name>  
  73.           <group-name>resin</group-name>  
  74.         
  75.     </server-default>  
  76.     <!-- 定義羣集服務器 -->  
  77.     <server id="" address="127.0.0.1" port="6800"/>  
  78.     <!--    Configures the persistent store for single-server or clustered 配置獨立服務器或者羣集的持久化存儲,專業版的功能    -->  
  79.     <resin:if test="${resin.isProfessional()}">  
  80.       <persistent-store type="cluster">  
  81.         <init path="session"/>  
  82.       </persistent-store>  
  83.     </resin:if>  
  84.     <!--   爲了安全, 你可以爲SSL會話(SSL sessions)定義一個不同的cookie. -->  
  85.         <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>  
  86.       
  87.     <!--  緩存啓用 (專業版的功能)   -->  
  88.     <resin:if test="${isResinProfessional}">  
  89.       <cache path="cache" memory-size="64M">  
  90.         <!-- Vary header rewriting for IE -->  
  91.         <rewrite-vary-as-private/>  
  92.       </cache>  
  93.     </resin:if>  
  94.     <!-- 啓用週期性的服務器狀態檢查和死鎖檢查,所有的服務器可以添加 <url> 來檢查。  -->  
  95.     <resin:if test="${isResinProfessional}">  
  96.       <ping>  
  97.         <!-- <url>http://localhost:8080/test-ping.jsp</url> -->  
  98.       </ping>  
  99.     </resin:if>  
  100.     <!-- 包含web應用的默認行爲  -->  
  101.     <resin:import path="${resin.home}/conf/app-default.xml"/>  
  102.     <!-- 每一個web應用的默認參數  -->  
  103.     <web-app-default>  
  104.       <!-- 擴展庫的公共jar文件,擴展是安全的即使沒有類裝載器知道的jars,裝載的類將爲每個應用分別裝載,也就是這些類都是不同的 -->  
  105.       <class-loader>  
  106.         <tree-loader path="${server.root}/ext-webapp"/>  
  107.       </class-loader>  
  108.       <!--  設置緩存頁、靜態也的延時值  -->  
  109.       <cache-mapping url-pattern="/" expires="5s"/>  
  110.       <cache-mapping url-pattern="*.gif" expires="60s"/>  
  111.       <cache-mapping url-pattern="*.jpg" expires="60s"/>  
  112.       <cache-mapping url-pattern="*.png" expires="60s"/>  
  113.       <!-- 啓用EL表達式 -->  
  114.       <allow-servlet-el/>  
  115.       <!--   安全原因, 默認禁用了會話的URLs -->  
  116.       <session-config>  
  117.         <enable-url-rewriting>false</enable-url-rewriting>  
  118.       </session-config>  
  119.       <!-- 安全原因, 在cookies中設置HttpOnly標誌 -->  
  120.           <cookie-http-only/>  
  121.             
  122.       <!--一些JSP包有不正確的 .tld文件。可以把validate-taglib-schema設置成false,可能繼續正常工作 Some JSP packages have incorrect .tld files.  It's possible to set validate-taglib-schema to false to work around these packages. -->  
  123.         <jsp>  
  124.           <validate-taglib-schema>true</validate-taglib-schema>  
  125.           <fast-jstl>true</fast-jstl>  
  126.           <fast-jsf>true</fast-jsf>  
  127.         </jsp>  
  128.     </web-app-default>  
  129.     <!-- 簡單的數據池配置 -->  
  130.         The JDBC name is java:comp/env/jdbc/test  
  131.          <database>  
  132.            <jndi-name>jdbc/mysql</jndi-name>  
  133.            <driver type="org.gjt.mm.mysql.Driver">  
  134.              <url>jdbc:mysql://localhost:3306/test</url>  
  135.              <user></user>  
  136.              <password></password>  
  137.             </driver>  
  138.             <prepared-statement-cache-size>8</prepared-statement-cache-size>  
  139.             <max-connections>20</max-connections>  
  140.             <max-idle-time>30s</max-idle-time>  
  141.           </database>  
  142.             
  143.     <!-- 定義所有虛擬主機的默認配置 -->  
  144.     <host-default>  
  145.       <!-- 如果和別的web服務器整合,這個可以被去掉,因爲web服務器也可以記錄這些信息。  -->  
  146.       <access-log path="logs/access.log" format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' rollover-period="1W"/>  
  147.       <!-- war 文件的佈置目錄  -->  
  148.       <web-app-deploy path="webapps"/>  
  149.       <!-- ear文件的佈置目錄 -->  
  150.       <ear-deploy path="deploy">  
  151.         <ear-default>  
  152.           <ejb-server>  
  153.             <config-directory>WEB-INF</config-directory>  
  154.             <data-source>jdbc/test</data-source>  
  155.           </ejb-server>  
  156.         </ear-default>  
  157.       </ear-deploy>  
  158.       <!-- rar文件的佈置目錄 -->  
  159.       <resource-deploy path="deploy"/>  
  160.     </host-default>  
  161.     <!-- 虛擬主機的佈置目錄 -->  
  162.     <host-deploy path="hosts">  
  163.       <host-default>  
  164.         <resin:import path="host.xml" optional="true"/>  
  165.       </host-default>  
  166.     </host-deploy>  
  167.     <!-- 默認的虛擬主機配置 -->  
  168.     <host id="" root-directory=".">  
  169.       <!-- 配置默認的應用 webapp's ROOT        -->  
  170.       <web-app id="/" root-directory="webapps/ROOT"/>  
  171.       <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">  
  172.         <!--  管理應用程序 /resin-admin password is the md5 hash of the password。md5碼的密碼。 localhost is true to limit access to the localhost。localhost設置成true,這樣只有localhost才能訪問 -->  
  173.         <prologue>  
  174.           <resin:set var="resin_admin_user" value=""/>  
  175.           <resin:set var="resin_admin_password" value=""/>  
  176.           <resin:set var="resin_admin_external" value="false"/>  
  177.         </prologue>  
  178.       </web-app>  
  179.     </host>  
  180.   </cluster>  
  181.   <!--  Configuration for the web-tier/load-balancer  -->  
  182.   <resin:if test="${resin.isProfessional()}">  
  183.     <cluster id="web-tier">  
  184.       <server-default>  
  185.         <!-- The http port -->  
  186.         <http address="*" port="9080"/>  
  187.       </server-default>  
  188.       <server id="web-a" address="127.0.0.1" port="6700"/>  
  189.       <cache path="cache" memory-size="64M"/>  
  190.       <host id="">  
  191.         <web-app id="/">  
  192.            <rewrite-dispatch>  
  193.              <load-balance regexp="" cluster="app-tier"/>  
  194.            </rewrite-dispatch>  
  195.         </web-app>  
  196.       </host>  
  197.     </cluster>  
  198.   </resin:if>  
  199. </resin>  
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章