resin配置文件详解

2024-04-29 04:08
文章标签 详解 配置文件 resin

本文主要是介绍resin配置文件详解,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

<!-- - Resin 3.1 配置文件. -->   
<resin xmlns="http://caucho.com/ns/resin" xmlns:resin="http://caucho.com/ns/resin/core">   
   <!-- 加载resin/lib下的所有.jar文件-->   
   <class-loader>   
     <tree-loader path="${resin.home}/lib"/>   
     <tree-loader path="${resin.root}/lib"/>   
   </class-loader>   
   <!-- - 管理配置 -->   
   <management path="${resin.root}/admin">   
   </management>   
   <!--   -JDK日志接口的配置.   -->   
   <log name="" path="stdout:" timestamp="[%H:%M:%S.%s] "/>   
   <!-- 日志信息的级别:'info' 生产环境  'fine' 开发环境 '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="25"/>   
   <!--     - 你可以把编译器改成 "javac", "eclipse" 或者 "internal".     -->   
   <javac compiler="internal" args="-source 1.5"/>   
  
   <!-- Security providers.   
     - <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">   
     <!-- 设置集群上下文的根, 相对于server.root -->   
     <root-directory>.</root-directory>   
     <server-default>   
       <!-- HTTP服务的端口-->   
       <http address="*" port="8080"/>   
       <!--   
         - SSL端口配置:   
         -   
         - <http address="*" port="8443">   
         -   <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>   
       <!-- Uncomment to enable admin heap dumps 去掉这个如果你想管理内存堆的倾倒   
         - <jvm-arg>-agentlib:resin</jvm-arg>   
         -->   
       <watchdog-arg>-Dcom.sun.management.jmxremote</watchdog-arg>   
       <!--   强制resin强制重起时的最小空闲内存     -->   
       <memory-free-min>1M</memory-free-min>   
       <!-- 最大线程数量. -->   
       <thread-max>256</thread-max>   
       <!--   套接字等待时间 -->   
       <socket-timeout>65s</socket-timeout>   
       <!-- 配置 keepalive -->   
       <keepalive-max>128</keepalive-max>   
       <keepalive-timeout>15s</keepalive-timeout>   
       <!--         - 如果使用的是UNIX,这里是启动的帐号和用户组.   
         - <user-name>resin</user-name>   
         - <group-name>resin</group-name>   
         -->   
     </server-default>   
     <!-- 定义群集服务器 -->   
     <server id="" address="127.0.0.1" port="6800"/>   
     <!--     Configures the persistent store for single-server or clustered 配置独立服务器或者群集的持久化存储,专业版的功能     -->   
     <resin:if test="${resin.isProfessional()}">   
       <persistent-store type="cluster">   
         <init path="session"/>   
       </persistent-store>   
     </resin:if>   
     <!--   为了安全, 你可以为SSL会话(SSL sessions)定义一个不同的cookie.   
       - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>   
       -->   
     <!--   缓存启用 (专业版的功能)   -->   
     <resin:if test="${isResinProfessional}">   
       <cache path="cache" memory-size="64M">   
         <!-- Vary header rewriting for IE -->   
         <rewrite-vary-as-private/>   
       </cache>   
     </resin:if>   
     <!-- 启用周期性的服务器状态检查和死锁检查,所有的服务器可以添加 <url> 来检查。   -->   
     <resin:if test="${isResinProfessional}">   
       <ping>   
         <!-- <url>http://localhost:8080/test-ping.jsp</url> -->   
       </ping>   
     </resin:if>   
     <!-- 包含web应用的默认行为   -->   
     <resin:import path="${resin.home}/conf/app-default.xml"/>   
     <!-- 每一个web应用的默认参数   -->   
     <web-app-default>   
       <!-- 扩展库的公共jar文件,扩展是安全的即使没有类装载器知道的jars,装载的类将为每个应用分别装载,也就是这些类都是不同的 -->   
       <class-loader>   
         <tree-loader path="${server.root}/ext-webapp"/>   
       </class-loader>   
       <!--   设置缓存页、静态也的延时值   -->   
       <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"/>   
       <!-- 启用EL表达式 -->   
       <allow-servlet-el/>   
       <!--   安全原因, 默认禁用了会话的URLs -->   
       <session-config>   
         <enable-url-rewriting>false</enable-url-rewriting>   
       </session-config>   
       <!-- 安全原因, 在cookies中设置HttpOnly标志   
         - <cookie-http-only/>   
         -->   
       <!--一些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.   
         -->   
         <jsp>   
           <validate-taglib-schema>true</validate-taglib-schema>   
           <fast-jstl>true</fast-jstl>   
           <fast-jsf>true</fast-jsf>   
         </jsp>   
     </web-app-default>   
     <!-- 简单的数据池配置   
       - 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服务器整合,这个可以被去掉,因为web服务器也可以记录这些信息。   -->   
       <access-log path="logs/access.log" format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"' rollover-period="1W"/>   
       <!-- war 文件的布置目录   -->   
       <web-app-deploy path="webapps"/>   
       <!-- ear文件的布置目录 -->   
       <ear-deploy path="deploy">   
         <ear-default>   
           <ejb-server>   
             <config-directory>WEB-INF</config-directory>   
             <data-source>jdbc/test</data-source>   
           </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=".">   
       <!-- 配置默认的应用 webapp's ROOT         -->   
       <web-app id="/" root-directory="webapps/ROOT"/>   
       <web-app id="/resin-admin" root-directory="${resin.home}/php/admin">   
         <!-- - 管理应用程序 /resin-admin   
           - password is the md5 hash of the password。md5码的密码。   
           - localhost is true to limit access to the localhost。localhost设置成true,这样只有localhost才能访问   
           -->   
         <prologue>   
           <resin:set var="resin_admin_user" value=""/>   
           <resin:set var="resin_admin_password" value=""/>   
           <resin:set var="resin_admin_external" value="false"/>   
         </prologue>   
       </web-app>   
     </host>   
   </cluster>   
   <!-- - Configuration for the web-tier/load-balancer   -->   
   <resin:if test="${resin.isProfessional()}">   
     <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>   
</resin> 

这篇关于resin配置文件详解的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/945074

相关文章

SQL BETWEEN 语句的基本用法详解

《SQLBETWEEN语句的基本用法详解》SQLBETWEEN语句是一个用于在SQL查询中指定查询条件的重要工具,它允许用户指定一个范围,用于筛选符合特定条件的记录,本文将详细介绍BETWEEN语... 目录概述BETWEEN 语句的基本用法BETWEEN 语句的示例示例 1:查询年龄在 20 到 30 岁

CSS place-items: center解析与用法详解

《CSSplace-items:center解析与用法详解》place-items:center;是一个强大的CSS简写属性,用于同时控制网格(Grid)和弹性盒(Flexbox)... place-items: center; 是一个强大的 css 简写属性,用于同时控制 网格(Grid) 和 弹性盒(F

spring中的ImportSelector接口示例详解

《spring中的ImportSelector接口示例详解》Spring的ImportSelector接口用于动态选择配置类,实现条件化和模块化配置,关键方法selectImports根据注解信息返回... 目录一、核心作用二、关键方法三、扩展功能四、使用示例五、工作原理六、应用场景七、自定义实现Impor

nginx启动命令和默认配置文件的使用

《nginx启动命令和默认配置文件的使用》:本文主要介绍nginx启动命令和默认配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录常见命令nginx.conf配置文件location匹配规则图片服务器总结常见命令# 默认配置文件启动./nginx

一文深入详解Python的secrets模块

《一文深入详解Python的secrets模块》在构建涉及用户身份认证、权限管理、加密通信等系统时,开发者最不能忽视的一个问题就是“安全性”,Python在3.6版本中引入了专门面向安全用途的secr... 目录引言一、背景与动机:为什么需要 secrets 模块?二、secrets 模块的核心功能1. 基

一文详解MySQL如何设置自动备份任务

《一文详解MySQL如何设置自动备份任务》设置自动备份任务可以确保你的数据库定期备份,防止数据丢失,下面我们就来详细介绍一下如何使用Bash脚本和Cron任务在Linux系统上设置MySQL数据库的自... 目录1. 编写备份脚本1.1 创建并编辑备份脚本1.2 给予脚本执行权限2. 设置 Cron 任务2

一文详解如何在idea中快速搭建一个Spring Boot项目

《一文详解如何在idea中快速搭建一个SpringBoot项目》IntelliJIDEA作为Java开发者的‌首选IDE‌,深度集成SpringBoot支持,可一键生成项目骨架、智能配置依赖,这篇文... 目录前言1、创建项目名称2、勾选需要的依赖3、在setting中检查maven4、编写数据源5、开启热

Python常用命令提示符使用方法详解

《Python常用命令提示符使用方法详解》在学习python的过程中,我们需要用到命令提示符(CMD)进行环境的配置,:本文主要介绍Python常用命令提示符使用方法的相关资料,文中通过代码介绍的... 目录一、python环境基础命令【Windows】1、检查Python是否安装2、 查看Python的安

HTML5 搜索框Search Box详解

《HTML5搜索框SearchBox详解》HTML5的搜索框是一个强大的工具,能够有效提升用户体验,通过结合自动补全功能和适当的样式,可以创建出既美观又实用的搜索界面,这篇文章给大家介绍HTML5... html5 搜索框(Search Box)详解搜索框是一个用于输入查询内容的控件,通常用于网站或应用程

Python中使用uv创建环境及原理举例详解

《Python中使用uv创建环境及原理举例详解》uv是Astral团队开发的高性能Python工具,整合包管理、虚拟环境、Python版本控制等功能,:本文主要介绍Python中使用uv创建环境及... 目录一、uv工具简介核心特点:二、安装uv1. 通过pip安装2. 通过脚本安装验证安装:配置镜像源(可