现在的位置: 首页 > 综合 > 正文

resin配置

2018年05月15日 ⁄ 综合 ⁄ 共 7584字 ⁄ 字号 评论关闭
  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.       <!--   
  44.          - SSL端口配置:   
  45.          -   
  46.          - <http address="*" port="8443">   
  47.          -   <openssl>   
  48.          -     <certificate-file>keys/gryffindor.crt</certificate-file>   
  49.          -     <certificate-key-file>keys/gryffindor.key</certificate-key-file>   
  50.          -     <password>test123</password>   
  51.          -   </openssl>   
  52.          - </http>   
  53.         -->   
  54.       <!--         - JVM参数设置        -->   
  55.       <jvm-arg>-Xmx256m</jvm-arg>   
  56.       <jvm-arg>-Xss1m</jvm-arg>   
  57.       <jvm-arg>-Xdebug</jvm-arg>   
  58.       <jvm-arg>-Dcom.sun.management.jmxremote</jvm-arg>   
  59.       <!-- Uncomment to enable admin heap dumps 去掉这个如果你想管理内存堆的倾倒   
  60.          - <jvm-arg>-agentlib:resin</jvm-arg>   
  61.         -->   
  62.       <watchdog-arg>-Dcom.sun.management.jmxremote</watchdog-arg>   
  63.       <!--   强制resin强制重起时的最小空闲内存    -->   
  64.       <memory-free-min>1M</memory-free-min>   
  65.       <!-- 最大线程数量. -->   
  66.       <thread-max>256</thread-max>   
  67.       <!--  套接字等待时间 -->   
  68.       <socket-timeout>65s</socket-timeout>   
  69.       <!-- 配置 keepalive -->   
  70.       <keepalive-max>128</keepalive-max>   
  71.       <keepalive-timeout>15s</keepalive-timeout>   
  72.       <!--         - 如果使用的是UNIX,这里是启动的帐号和用户组.   
  73.          - <user-name>resin</user-name>   
  74.          - <group-name>resin</group-name>   
  75.         -->   
  76.     </server-default>   
  77.     <!-- 定义群集服务器 -->   
  78.     <server id="" address="127.0.0.1" port="6800"/>   
  79.     <!--    Configures the persistent store for single-server or clustered 配置独立服务器或者群集的持久化存储,专业版的功能    -->   
  80.     <resin:if test="${resin.isProfessional()}">   
  81.       <persistent-store type="cluster">   
  82.         <init path="session"/>   
  83.       </persistent-store>   
  84.     </resin:if>   
  85.     <!--   为了安全, 你可以为SSL会话(SSL sessions)定义一个不同的cookie.   
  86.        - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>   
  87.       -->   
  88.     <!--  缓存启用 (专业版的功能)   -->   
  89.     <resin:if test="${isResinProfessional}">   
  90.       <cache path="cache" memory-size="64M">   
  91.         <!-- Vary header rewriting for IE -->   
  92.         <rewrite-vary-as-private/>   
  93.       </cache>   
  94.     </resin:if>   
  95.     <!-- 启用周期性的服务器状态检查和死锁检查,所有的服务器可以添加 <url> 来检查。  -->   
  96.     <resin:if test="${isResinProfessional}">   
  97.       <ping>   
  98.         <!-- <url>http://localhost:8080/test-ping.jsp</url> -->   
  99.       </ping>   
  100.     </resin:if>   
  101.     <!-- 包含web应用的默认行为  -->   
  102.     <resin:import path="${resin.home}/conf/app-default.xml"/>   
  103.     <!-- 每一个web应用的默认参数  -->   
  104.     <web-app-default>   
  105.       <!-- 扩展库的公共jar文件,扩展是安全的即使没有类装载器知道的jars,装载的类将为每个应用分别装载,也就是这些类都是不同的 -->   
  106.       <class-loader>   
  107.         <tree-loader path="${server.root}/ext-webapp"/>   
  108.       </class-loader>   
  109.       <!--  设置缓存页、静态也的延时值  -->   
  110.       <cache-mapping url-pattern="/" expires="5s"/>   
  111.       <cache-mapping url-pattern="*.gif" expires="60s"/>   
  112.       <cache-mapping url-pattern="*.jpg" expires="60s"/>   
  113.       <cache-mapping url-pattern="*.png" expires="60s"/>   
  114.       <!-- 启用EL表达式 -->   
  115.       <allow-servlet-el/>   
  116.       <!--   安全原因, 默认禁用了会话的URLs -->   
  117.       <session-config>   
  118.         <enable-url-rewriting>false</enable-url-rewriting>   
  119.       </session-config>   
  120.       <!-- 安全原因, 在cookies中设置HttpOnly标志   
  121.          - <cookie-http-only/>   
  122.         -->   
  123.       <!--一些JSP包有不正确的 .tld文件。可以把validate-taglib-schema设置成false,可能继续正常工作   
  124.          - Some JSP packages have incorrect .tld files.  It's possible to set validate-taglib-schema to false to work around these packages.   
  125.         -->   
  126.         <jsp>   
  127.           <validate-taglib-schema>true</validate-taglib-schema>   
  128.           <fast-jstl>true</fast-jstl>   
  129.           <fast-jsf>true</fast-jsf>   
  130.         </jsp>   
  131.     </web-app-default>   
  132.     <!-- 简单的数据池配置   
  133.        - The JDBC name is java:comp/env/jdbc/test   
  134.          <database>   
  135.            <jndi-name>jdbc/mysql</jndi-name>   
  136.            <driver type="org.gjt.mm.mysql.Driver">   
  137.              <url>jdbc:mysql://localhost:3306/test</url>   
  138.              <user></user>   
  139.              <password></password>   
  140.             </driver>   
  141.             <prepared-statement-cache-size>8</prepared-statement-cache-size>   
  142.             <max-connections>20</max-connections>   
  143.             <max-idle-time>30s</max-idle-time>   
  144.           </database>   
  145.       -->   
  146.     <!-- 定义所有虚拟主机的默认配置 -->   
  147.     <host-default>   
  148.       <!-- 如果和别的web服务器整合,这个可以被去掉,因为web服务器也可以记录这些信息。  -->   
  149.       <access-log path="logs/access.log" format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' rollover-period="1W"/>   
  150.       <!-- war 文件的布置目录  -->   
  151.       <web-app-deploy path="webapps"/>   
  152.       <!-- ear文件的布置目录 -->   
  153.       <ear-deploy path="deploy">   
  154.         <ear-default>   
  155.           <ejb-server>   
  156.             <config-directory>WEB-INF</config-directory>   
  157.             <data-source>jdbc/test</data-source>   
  158.           </ejb-server>   
  159.         </ear-default>   
  160.       </ear-deploy>   
  161.       <!-- rar文件的布置目录 -->   
  162.       <resource-deploy path="deploy"/>   
  163.     </host-default>   
  164.     <!-- 虚拟主机的布置目录 -->   
  165.     <host-deploy path="hosts">   
  166.       <host-default>   
  167.         <resin:import path="host.xml" optional="true"/>   
  168.       </host-default>   
  169.     </host-deploy>   
  170.     <!-- 默认的虚拟主机配置 -->   
  171.     <host id="" root-directory=".">   
  172.       <!-- 配置默认的应用 webapp's ROOT        -->   
  173.       <web-app id="/" root-directory="webapps/ROOT"/>   
  174.       <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">   
  175.         <!-- - 管理应用程序 /resin-admin   
  176.            - password is the md5 hash of the password。md5码的密码。   
  177.            - localhost is true to limit access to the localhost。localhost设置成true,这样只有localhost才能访问   
  178.           -->   
  179.         <prologue>   
  180.           <resin:set var="resin_admin_user" value=""/>   
  181.           <resin:set var="resin_admin_password" value=""/>   
  182.           <resin:set var="resin_admin_external" value="false"/>   
  183.         </prologue>   
  184.       </web-app>   
  185.     </host>   
  186.   </cluster>   
  187.   <!-- - Configuration for the web-tier/load-balancer  -->   
  188.   <resin:if test="${resin.isProfessional()}">   
  189.     <cluster id="web-tier">   
  190.       <server-default>   
  191.         <!-- The http port -->   
  192.         <http address="*" port="9080"/>   
  193.       </server-default>   
  194.       <server id="web-a" address="127.0.0.1" port="6700"/>   
  195.       <cache path="cache" memory-size="64M"/>   
  196.       <host id="">   
  197.         <web-app id="/">   
  198.            <rewrite-dispatch>   
  199.              <load-balance regexp="" cluster="app-tier"/>   
  200.            </rewrite-dispatch>   
  201.         </web-app>   
  202.       </host>   
  203.     </cluster>   
  204.   </resin:if>   
  205. </resin>  

抱歉!评论已关闭.