resin的多站点及优化配置

 resin和tomcat一样,用于处理jsp的容器,前端可以用Nginx反向代理和做缓存加速。下面是一些resin优化和多站点配置总结

 

//不检查程序更新配置

  <dependency-check-interval>-1s</dependency-check-interval>

 

 //日志输出配置

   <stdout-log path-format="log/stdout.log.%Y%m%d" timestamp="[%Y-%m-%d %H:%M:%S]" rollover-period= "1D" />

    <stderr-log path-format="log/stderr.log.%Y%m%d" timestamp="[%Y-%m-%d %H:%M:%S]" rollover-period= "1D" />

    <access-log path-format="logs/access.log.%Y%m%d_%H" rollover-period= "1D" />

 

//调整图片Cache图片文件的时间

     <web-app-default>

       <cache-mapping url-pattern="*.gif" expires="600s"/>

       <cache-mapping url-pattern="*.jpg" expires="600s"/>

       <cache-mapping url-pattern="*.png" expires="600s"/>

     </web-app-default>

 

//配置多个站点

<cluster id="gd">

<server-default>

<socket-timeout>20s</socket-timeout>

<keepalive-max>3000</keepalive-max>

<keepalive-timeout>20s</keepalive-timeout>

<load-balance-idle-time>30s</load-balance-idle-time>

    <thread-max>5120</thread-max>

     <jvm-arg>-Xms1024m</jvm-arg>

            <jvm-arg>-Xmx1024m</jvm-arg>

            <jvm-arg>-Xss256m</jvm-arg>

            <jvm-arg>-server</jvm-arg>

    </server-default>

        <resin:import path="${resin.home}/conf/app-default.xml"/>

    <server id="gd" address="127.0.0.1" port="6800">

        <http id="" port="8080"/>

    </server>

    <host id="" root-directory=".">

           <web-app id="/" root-directory="/usr/local/wwwweb" /> 站点1

           <character-encoding>UTF-8</character-encoding> 编码设置

    </host>

  </cluster>

 

  <cluster id="qd">

    <server-default>

<socket-timeout>20s</socket-timeout>

<keepalive-max>3000</keepalive-max>

<keepalive-timeout>20s</keepalive-timeout>

<load-balance-idle-time>30s</load-balance-idle-time>

    <thread-max>5120</thread-max>

<jvm-arg>-Xms1024m</jvm-arg>

           <jvm-arg>-Xmx1024m</jvm-arg>

           <jvm-arg>-Xss256m</jvm-arg>

           <jvm-arg>-server</jvm-arg>

    </server-default>

        <resin:import path="${resin.home}/conf/app-default.xml"/>

    <server id="qd" address="127.0.0.1" port="6801">

        <http id="" port="8081"/>

    </server>

    <host id="" root-directory=".">

           <web-app id="/" root-directory="/usr/local/wwwweb1"/> 站点2

           <character-encoding>UTF-8</character-encoding> 编码设置

    </host>

  </cluster>

 

用<cluster> </cluster>字段来隔开多个站点

 

 

 

 

 

你可能感兴趣的:(优化,resin,职场,休闲,多站点,jsp容器)