cluster-default.xml 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <resin xmlns="http://caucho.com/ns/resin"
  2. xmlns:resin="urn:java:com.caucho.resin">
  3. <!--
  4. - default configuration applied to all clusters
  5. -->
  6. <cluster-default>
  7. <!-- shared webapp jars for non-classloader-aware libraries -->
  8. <web-app-default>
  9. <class-loader>
  10. <library-loader path="${resin.root}/webapp-jars"/>
  11. <library-loader path="${resin.root}/webapp.d/lib"/>
  12. <library-loader path="config:/webapp.d/lib"/>
  13. </class-loader>
  14. </web-app-default>
  15. <!-- shared jars and drivers for the app-tier -->
  16. <class-loader>
  17. <tree-loader path="${resin.root}/${cluster.id}-inf"/>
  18. </class-loader>
  19. <!-- enables development error pages -->
  20. <resin:if test="${dev_mode}">
  21. <development-mode-error-page/>
  22. </resin:if>
  23. <!--
  24. - Enables the proxy cache (available in Resin Professional)
  25. -->
  26. <resin:if test="${proxy_cache_enable}">
  27. <proxy-cache memory-size="${proxy_cache_size}">
  28. <!-- Vary header rewriting for IE -->
  29. <rewrite-vary-as-private/>
  30. </proxy-cache>
  31. </resin:if>
  32. <!--
  33. - Admin services
  34. -->
  35. <resin:if test="${remote_admin_enable}">
  36. <resin:RemoteAdminService/>
  37. </resin:if>
  38. <resin:AdminServices/>
  39. <resin:if test="${elastic_cloud_enable}">
  40. <resin:ElasticCloudService/>
  41. </resin:if>
  42. <!-- defaults for each server, i.e. JVM -->
  43. <server-default>
  44. <jvm-arg-line>${jvm_args}</jvm-arg-line>
  45. <jvm-mode>${jvm_mode}</jvm-mode>
  46. <!--
  47. - If starting Resin as root on Unix, specify the user name
  48. - and group name for the web server user.
  49. -->
  50. <user-name>${setuid_user}</user-name>
  51. <group-name>${setuid_group}</group-name>
  52. <port-default>
  53. <port-thread-max>${port_thread_max}</port-thread-max>
  54. <accept-thread-min>${accept_thread_min}</accept-thread-min>
  55. <accept-thread-max>${accept_thread_max}</accept-thread-max>
  56. <keepalive-max>${keepalive_max?:-1}</keepalive-max>
  57. <tcp-cork>${tcp_cork}</tcp-cork>
  58. </port-default>
  59. <sendfile-enable>${sendfile}</sendfile-enable>
  60. <keepalive-select-enable>${keepalive_select_enable}</keepalive-select-enable>
  61. <!-- The http port -->
  62. <http address="${http_address?:'*'}" port="${http}"/>
  63. <!-- SSL port configuration: -->
  64. <resin:choose>
  65. <resin:when test="${openssl_file != null}">
  66. <http address="${http_address?:'*'}" port="${https}">
  67. <openssl>
  68. <certificate-file>${file_lookup(openssl_file,__DIR__)}</certificate-file>
  69. <certificate-key-file>${file_lookup(openssl_key, __DIR__)}</certificate-key-file>
  70. <password>
  71. <resin:Password>${openssl_password}</resin:Password>
  72. </password>
  73. </openssl>
  74. </http>
  75. </resin:when>
  76. <resin:when test="${jsse_keystore_file != null}">
  77. <http address="${http_address?:'*'}" port="${https}">
  78. <jsse-ssl>
  79. <key-store-type>${jsse_keystore_type?:'jks'}</key-store-type>
  80. <key-store-file>${jsse_keystore_file}</key-store-file>
  81. <password>
  82. <resin:Password>${jsse_keystore_password}</resin:Password>
  83. </password>
  84. </jsse-ssl>
  85. </http>
  86. </resin:when>
  87. <resin:when test="${class_exists('sun.security.x509.CertAndKeyGen') || class_exists('sun.security.tools.keytool.CertAndKeyGen')}">
  88. <http address="${http_address?:'*'}" port="${https}">
  89. <jsse-ssl self-signed-certificate-name="resin@localhost"/>
  90. </http>
  91. </resin:when>
  92. </resin:choose>
  93. </server-default>
  94. <!--
  95. - Default host configuration applied to all virtual hosts.
  96. -->
  97. <host-default>
  98. <access-log path="/data/log/other/access.log"
  99. format='v2{]b.easou.com{]%r{]%{uid_bi}c{]%{%Y%m%d %H%M%S%s}t{]%s{]-{]%D{]%b{]%b{]%{X-Real-IP}i{]%{X-Forwarded-For}i{]%{Referer}i{]-{]%{User-Agent}i{]online_ta{]%{uid_bi}c{]-{]%{uid}c{]%{cid}c{]{]v2'
  100. rollover-period="1h"/>
  101. <!--
  102. - Defaults applied to each web-app.
  103. -->
  104. <web-app-default>
  105. <prologue>
  106. <allow-servlet-el/>
  107. </prologue>
  108. <!--
  109. - Sets max-age for cacheable pages, e.g. static pages.
  110. -->
  111. <cache-mapping url-pattern="/" max-age="5s"/>
  112. <cache-mapping url-pattern="*.gif" max-age="60s"/>
  113. <cache-mapping url-pattern="*.jpg" max-age="60s"/>
  114. <cache-mapping url-pattern="*.png" max-age="60s"/>
  115. <cache-mapping url-pattern="*.css" max-age="60s"/>
  116. <cache-mapping url-pattern="*.js" max-age="60s"/>
  117. <session-config>
  118. <use-persistent-store>${session_store}</use-persistent-store>
  119. <enable-url-rewriting>false</enable-url-rewriting>
  120. </session-config>
  121. </web-app-default>
  122. </host-default>
  123. <!--
  124. <host id="${web_admin_host}" root-directory="${web_admin_host}">
  125. -->
  126. <host-default>
  127. <!--
  128. - Administration application /resin-admin
  129. -->
  130. <resin:if test="${web_admin_enable}">
  131. <web-app id="/resin-admin" root-directory="${resin.root}/doc/admin">
  132. <prologue>
  133. <!-- only allow access from internal IP (10.*,192.168.*,127.*) -->
  134. <resin:set var="resin_admin_external"
  135. value="${web_admin_external}"/>
  136. <resin:set var="resin_admin_insecure"
  137. value="${! web_admin_ssl}"/>
  138. </prologue>
  139. </web-app>
  140. </resin:if>
  141. <resin:if test="${rest_admin_enable}">
  142. <web-app id="/resin-rest"
  143. root-directory="${resin.root}/doc/resin-rest">
  144. <resin:BasicLogin realm-name="resin"/>
  145. <resin:Allow url-pattern="/*">
  146. <resin:IfUserInRole role="resin-admin"/>
  147. </resin:Allow>
  148. <servlet-mapping url-pattern="/*"
  149. servlet-class="com.caucho.admin.servlet.AdminRestServlet">
  150. <init>
  151. <require-secure>${rest_admin_ssl}</require-secure>
  152. </init>
  153. </servlet-mapping>
  154. </web-app>
  155. </resin:if>
  156. </host-default>
  157. <!-- include resources config files in resources/ -->
  158. <resin:import fileset="${resin.root}/${cluster.id}-inf/**/*.xml"/>
  159. <!-- standard servlet behavior, including .jsp, .php, and WEB-INF -->
  160. <resin:import path="${__DIR__}/app-default.xml"/>
  161. </cluster-default>
  162. </resin>