resin配置中文说明

来源:互联网 发布:清大世纪教育集团 知乎 编辑:程序博客网 时间:2024/05/10 05:13
  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>  

转自:http://phoenix007.javaeye.com/blog/258660

原创粉丝点击