resin.conf.bak 13.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450
<!--
   - Resin 3.1 configuration file.
  -->
<resin xmlns="http://caucho.com/ns/resin"
       xmlns:resin="http://caucho.com/ns/resin/core">
  
  <system-property java.io.tmpdir="tmp"/>

  <resin:if test="${server_default_port==null}">
    <system-property server_default_port="9081"/>
  </resin:if>

  <resin:if test="${javac_compiler==null}">
    <system-property javac_compiler="${JAVA_HOME}\bin\javac"/>
  </resin:if>

  <resin:if test="${watchdog_port==null}">
    <system-property watchdog_port="7601"/>
  </resin:if>

  <resin:if test="${jvm_arg_HeapDumpPath==null}">
    <system-property jvm_arg_HeapDumpPath="${resin.home}/dump"/>
  </resin:if>

  <resin:if test="${cluster_server_port==null}">
    <system-property cluster_server_port="7800"/>
  </resin:if>

  <resin:message>server_default_port: ${server_default_port}</resin:message>
  <resin:message>javac_compiler: ${javac_compiler}</resin:message>
  <resin:message>watchdog_port: ${watchdog_port}</resin:message>
  <resin:message>cluster_server_port: ${cluster_server_port}</resin:message>
  <resin:message>jvm_arg_HeapDumpPath: ${jvm_arg_HeapDumpPath}</resin:message>

  <!-- adds all .jar files under the resin/lib directory -->
  <class-loader>
    <tree-loader path="${resin.home}/ext-lib"/>
    <tree-loader path="${resin.root}/ext-lib"/>

    <tree-loader path="${resin.home}/lib"/>
    <tree-loader path="${resin.root}/lib"/>
  </class-loader>

  <!--
     - Management configuration
     -
     - Remote management requires at least one enabled admin user.
    -->
  <management path="${resin.root}/admin">
    <user name="admin" password="password" disable="true"/>

    <resin:if test="${resin.professional}">
      <deploy-service/>
      <jmx-service/>
      <log-service/>
      <xa-log-service/>
    </resin:if>
  </management>

  <!--
     - Logging configuration for the JDK logging API.
    -->
  <log name="" level="info" path="stdout:"
       timestamp="[%H:%M:%S.%s] {%{thread}} "/>

  <!--
     - 'info' for production
     - 'fine' or 'finer' for development and troubleshooting
    -->
  <logger name="com.caucho" level="info"/>

  <logger name="com.caucho.java" level="config"/>
  <logger name="com.caucho.loader" level="config"/>

  <!--
     - For production sites, change dependency-check-interval to something
     - like 600s, so it only checks for updates every 10 minutes.
    -->
  <dependency-check-interval>10s</dependency-check-interval>

  <!--
     - SMTP server for sending mail notifications
    -->
  <system-property mail.smtp.host="127.0.0.1"/>
  <system-property mail.smtp.port="25"/>
  <system-property javax.xml.stream.XMLInputFactory="com.sun.xml.internal.stream.XMLInputFactoryImpl" />
  <system-property log4j2.disable.jmx="true"/>

  <!--
     - Sets the default character encoding to utf-8
     -
     - <character-encoding>utf-8</character-encoding>
    -->

  <!--
     - You can change the compiler to "javac", "eclipse" or "internal".
    -->
  <!-- <javac compiler="javac" args="-source 1.5"/> -->
  <!-- <javac compiler="D:\WEAVER\JDK\bin\javac" args="-encoding UTF-8"/> -->
  <javac compiler="${javac_compiler}" args="-encoding UTF-8"/>

  <!-- Security providers.
     - <security-provider>
     -    com.sun.net.ssl.internal.ssl.Provider
     - </security-provider>
    -->

  <!-- Uncomment to use Resin's XML implementations
     -
     - <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">
	<session-cookie>MJSESSIONID</session-cookie>
    <!-- sets the content root for the cluster, relative to server.root -->
    <root-directory>.</root-directory>
    <redeploy-mode>manual</redeploy-mode>

    <server-default>

      <!-- The http port -->
      
      <!-- <http address="*" port="9081"/> -->
      
      <!--
	<http address="*" port="9081"/>
	-->
	<http address="*" port="${server_default_port}"/>

      <!--
      <resin:choose>
        <resin:when test="${server_default_port!=null}">
          <http address="*" port="${server_default_port}"/>
        </resin:when>
        <resin:otherwise>
          <http address="*" port="9081"/>
        </resin:otherwise>
      </resin:choose>
      -->

      <!--
         - SSL port configuration:
         -
         - <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>
        -->

      <!--
         - The JVM arguments
        -->
      <jvm-arg>-Xmx512m</jvm-arg>
      <jvm-arg>-Xms512m</jvm-arg>
      <jvm-arg>-Xss256k</jvm-arg>
      <jvm-arg>-XX:PermSize=256m</jvm-arg>
      <jvm-arg>-XX:MaxPermSize=384m</jvm-arg>
      <jvm-arg>-XX:ParallelGCThreads=20</jvm-arg>
      <jvm-arg>-XX:+UseConcMarkSweepGC</jvm-arg>
      <jvm-arg>-XX:+UseParNewGC</jvm-arg>
      <jvm-arg>-XX:+DisableExplicitGC</jvm-arg>
      <!--
      <jvm-arg>-verbose:class</jvm-arg>
      -->
      <!--
      <jvm-arg>-verbose:gc</jvm-arg>
      <jvm-arg>-XX:+PrintGCDetails</jvm-arg>
      <jvm-arg>-XX:+PrintGCTimeStamps</jvm-arg>
      -->
      
      <resin:if test="${jvm_arg_HeapDumpPath!=null}">
        <jvm-arg>-XX:+HeapDumpOnOutOfMemoryError</jvm-arg>  
        <jvm-arg>-XX:HeapDumpPath=${jvm_arg_HeapDumpPath}</jvm-arg>
      </resin:if>

      <!--
         - Uncomment to enable admin heap dumps
         - <jvm-arg>-agentlib:resin</jvm-arg>
        -->

      <!--
         - arguments for the watchdog process
        -->
      <watchdog-jvm-arg>-Dcom.sun.management.jmxremote</watchdog-jvm-arg>

      <resin:choose>
        <resin:when test="${watchdog_port!=null}">
          <watchdog-port>${watchdog_port}</watchdog-port>
        </resin:when>
        <resin:otherwise>
          <watchdog-port>7601</watchdog-port>
        </resin:otherwise>
      </resin:choose>

      <!--
         - Configures the minimum free memory allowed before Resin
         - will force a restart.
        -->
      <memory-free-min>1M</memory-free-min>

      <!-- Maximum number of threads. -->
      <thread-max>2000</thread-max>

      <!-- Configures the socket timeout -->
      <socket-timeout>65s</socket-timeout>

      <!-- Configures the keepalive -->
      <keepalive-max>128</keepalive-max>
      <keepalive-timeout>15s</keepalive-timeout>

      <!--
         - If starting bin/resin as root on Unix, specify the user name
         - and group name for the web server user.
         -
         - <user-name>resin</user-name>
         - <group-name>resin</group-name>
        -->
    </server-default>

    <!-- define the servers in the cluster -->
    <!--
	<server id="" address="127.0.0.1" port="7800"/>
	-->

	<server id="" address="127.0.0.1" port="${cluster_server_port}">
	</server>

    <!--
       - Configures the persistent store for single-server or clustered
       - in Resin professional.
      -->
    <resin:if test="${resin.professional}">
      <persistent-store type="cluster">
        <init path="session"/>
      </persistent-store>
    </resin:if>

    <!--
       - For security, use a different cookie for SSL sessions.
       - <ssl-session-cookie>SSL_JSESSIONID</ssl-session-cookie>
      -->

    <!--
       - Enables the cache (available in Resin Professional) 
      -->
    <resin:if test="${resin.professional}">
      <cache path="cache" memory-size="64M">
        <!-- Vary header rewriting for IE -->
        <rewrite-vary-as-private/>
      </cache>
    </resin:if>

    <!--
       - Enables periodic checking of the server status and
       - check for deadlocks..
       -
       - All servers can add <url>s to be checked.
      -->
    <resin:if test="${resin.professional}">
      <ping>
        <!-- <url>http://localhost:8080/test-ping.jsp</url> -->
      </ping>
    </resin:if>

    <!--
       - Defaults applied to each web-app.
      -->
    <web-app-default>
      <prologue>
        <!--
           - Extension library for common jar files.  The ext is safe
           - even for non-classloader aware jars.  The loaded classes
           - will be loaded separately for each web-app, i.e. the class
           - itself will be distinct.
          -->
        <class-loader>
          <tree-loader path="${resin.root}/ext-webapp-lib"/>
        </class-loader>

        <!--
           - Enable EL expressions in Servlet and Filter init-param
          -->
        <allow-servlet-el/>
      </prologue>
      
      <!--
         - Sets timeout values for cacheable pages, e.g. static pages.
        -->
      <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"/>

      <!--
         - for security, disable session URLs by default.
        -->
      <session-config>
        <enable-url-rewriting>false</enable-url-rewriting>
      </session-config>

      <!--
         - For security, set the HttpOnly flag in cookies.
         - <cookie-http-only/>
        -->

      <!--
         - 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>
        </jsp>
    </web-app-default>

    <!-- includes the app-default for default web-app behavior -->
    <resin:import path="${resin.home}/conf/app-default.xml"/>

    <!--
       - Sample database pool configuration
       -
       - 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>
      -->

    <!--
       - Default host configuration applied to all virtual hosts.
      -->
    <host-default>
      <!--
         - With another web server, like Apache, this can be commented out
         - because the web server will log this information.
        -->
      <!-- 
      <access-log path="logs/access.log" 
            format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
            rollover-period="1W"/>
        -->
	
    	<access-log path="logs/access.log" 
    	   archive-format="access-%Y%m%d.log.gz" 
    		    format='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
    		    rollover-period="1D" rollover-count="10">
    	     <exclude>\.gif$</exclude>
    	   <exclude>\.jpg$</exclude>
    	   <exclude>\.png$</exclude>
    	   <exclude>\.js$</exclude>
    	   <exclude>\.css$</exclude>
    	   <exclude>\.html$</exclude>
    	   <exclude>\.htm$</exclude>
    	   <exclude>\.swf$</exclude>
    	   <exclude>\.cur$</exclude>
    	</access-log>
    	<stdout-log path="log/stdout.log" 
    	    archive-format="stdout-%Y%m%d.log.gz"
    	    timestamp="[%Y.%m.%d %H:%M:%S.%s]"
    	    rollover-period="1D" rollover-count="10"/>
    	<stderr-log path="log/stderr.log" 
    	    archive-format="stderr-%Y%m%d.log.gz"
    	    timestamp="[%Y.%m.%d %H:%M:%S.%s]"
    	    rollover-period="1D" rollover-count="10"/>

      <!-- creates the webapps directory for .war expansion -->
      <web-app-deploy path="webapps"/>

      <!-- creates the deploy directory for .ear expansion -->
      <ear-deploy path="deploy">
        <ear-default>
          <ejb-server>
            <config-directory>WEB-INF</config-directory>
          </ejb-server>
        </ear-default>
      </ear-deploy>

      <!-- creates the deploy directory for .rar expansion -->
      <resource-deploy path="deploy"/>
    </host-default>

    <!-- configures a deployment directory for virtual hosts -->
    <host-deploy path="hosts">
      <host-default>
        <resin:import path="host.xml" optional="true"/>
      </host-default>
    </host-deploy>

    <!-- configures the default host, matching any host name -->
    <host id="" root-directory=".">
      <redeploy-mode>manual</redeploy-mode>
      <!--
         - configures an explicit root web-app matching the
         - webapp's ROOT
        -->
      <!-- 
      <web-app id="/" root-directory="webapps/ROOT"/>
      -->
      <!-- <web-app id="/monitor-web" root-directory="D:\WEAVER\monitor-client"
             archive-path="D:\WEAVER\monitor-archive\monitor-web.war"/> -->

      <!-- <web-app id="/" root-directory="${resin.home}/monitor/app">
        <servlet-mapping url-pattern='/weaver/*' servlet-name='invoker'/>
      </web-app> -->

      <web-app id="/" root-directory="app" />

    </host>
  </cluster>

  <!--
     - Configuration for the web-tier/load-balancer
    -->
  <resin:if test="${resin.professional}">
    <cluster id="web-tier">
      <server-default>
        <!-- The http port -->
        <http address="*" port="9081"/>
      </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>