[32118] | 1 | <?xml version="1.0"?>
|
---|
| 2 | <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
|
---|
| 3 |
|
---|
| 4 | <!-- =============================================================== -->
|
---|
| 5 | <!-- Configure the Jetty Server -->
|
---|
| 6 | <!-- -->
|
---|
| 7 | <!-- Documentation of this file format can be found at: -->
|
---|
| 8 | <!-- http://wiki.eclipse.org/Jetty/Reference/jetty.xml_syntax -->
|
---|
| 9 | <!-- -->
|
---|
| 10 | <!-- =============================================================== -->
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | <Configure id="Server" class="org.eclipse.jetty.server.Server">
|
---|
| 14 |
|
---|
| 15 | <!-- =========================================================== -->
|
---|
| 16 | <!-- Configure the Server Thread Pool. -->
|
---|
| 17 | <!-- The server holds a common thread pool which is used by -->
|
---|
| 18 | <!-- default as the executor used by all connectors and servlet -->
|
---|
| 19 | <!-- dispatches. -->
|
---|
| 20 | <!-- -->
|
---|
| 21 | <!-- Configuring a fixed thread pool is vital to controlling the -->
|
---|
| 22 | <!-- maximal memory footprint of the server and is a key tuning -->
|
---|
| 23 | <!-- parameter for tuning. In an application that rarely blocks -->
|
---|
| 24 | <!-- then maximal threads may be close to the number of 5*CPUs. -->
|
---|
| 25 | <!-- In an application that frequently blocks, then maximal -->
|
---|
| 26 | <!-- threads should be set as high as possible given the memory -->
|
---|
| 27 | <!-- available. -->
|
---|
| 28 | <!-- -->
|
---|
| 29 | <!-- Consult the javadoc of o.e.j.util.thread.QueuedThreadPool -->
|
---|
| 30 | <!-- for all configuration that may be set here. -->
|
---|
| 31 | <!-- =========================================================== -->
|
---|
| 32 | <Arg name="threadpool">
|
---|
| 33 | <New id="threadpool" class="com.codahale.metrics.jetty9.InstrumentedQueuedThreadPool">
|
---|
| 34 | <Arg name="registry">
|
---|
| 35 | <Call id="solrJettyMetricRegistry" name="getOrCreate" class="com.codahale.metrics.SharedMetricRegistries">
|
---|
| 36 | <Arg>solr.jetty</Arg>
|
---|
| 37 | </Call>
|
---|
| 38 | </Arg>
|
---|
| 39 | </New>
|
---|
| 40 | </Arg>
|
---|
| 41 |
|
---|
| 42 | <Get name="ThreadPool">
|
---|
| 43 | <Set name="minThreads" type="int"><Property name="solr.jetty.threads.min" default="10"/></Set>
|
---|
| 44 | <Set name="maxThreads" type="int"><Property name="solr.jetty.threads.max" default="10000"/></Set>
|
---|
| 45 | <Set name="idleTimeout" type="int"><Property name="solr.jetty.threads.idle.timeout" default="120000"/></Set>
|
---|
| 46 | <Set name="stopTimeout" type="int"><Property name="solr.jetty.threads.stop.timeout" default="60000"/></Set>
|
---|
| 47 | <Set name="detailedDump">false</Set>
|
---|
| 48 | </Get>
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | <!-- =========================================================== -->
|
---|
| 52 | <!-- Http Configuration. -->
|
---|
| 53 | <!-- This is a common configuration instance used by all -->
|
---|
| 54 | <!-- connectors that can carry HTTP semantics (HTTP, HTTPS, SPDY)-->
|
---|
| 55 | <!-- It configures the non wire protocol aspects of the HTTP -->
|
---|
| 56 | <!-- semantic. -->
|
---|
| 57 | <!-- -->
|
---|
| 58 | <!-- This configuration is only defined here and is used by -->
|
---|
| 59 | <!-- reference from the jetty-http.xml, jetty-https.xml and -->
|
---|
| 60 | <!-- jetty-spdy.xml configuration files which instantiate the -->
|
---|
| 61 | <!-- connectors. -->
|
---|
| 62 | <!-- -->
|
---|
| 63 | <!-- Consult the javadoc of o.e.j.server.HttpConfiguration -->
|
---|
| 64 | <!-- for all configuration that may be set here. -->
|
---|
| 65 | <!-- =========================================================== -->
|
---|
| 66 | <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
|
---|
| 67 | <Set name="secureScheme">https</Set>
|
---|
| 68 | <Set name="securePort"><Property name="solr.jetty.secure.port" default="8443" /></Set>
|
---|
| 69 | <Set name="outputBufferSize"><Property name="solr.jetty.output.buffer.size" default="32768" /></Set>
|
---|
| 70 | <Set name="outputAggregationSize"><Property name="solr.jetty.output.aggregation.size" default="8192" /></Set>
|
---|
| 71 | <Set name="requestHeaderSize"><Property name="solr.jetty.request.header.size" default="8192" /></Set>
|
---|
| 72 | <Set name="responseHeaderSize"><Property name="solr.jetty.response.header.size" default="8192" /></Set>
|
---|
| 73 | <Set name="sendServerVersion"><Property name="solr.jetty.send.server.version" default="false" /></Set>
|
---|
| 74 | <Set name="sendDateHeader"><Property name="solr.jetty.send.date.header" default="false" /></Set>
|
---|
| 75 | <Set name="headerCacheSize"><Property name="solr.jetty.header.cache.size" default="512" /></Set>
|
---|
| 76 | <Set name="delayDispatchUntilContent"><Property name="solr.jetty.delayDispatchUntilContent" default="false"/></Set>
|
---|
| 77 | <!-- Uncomment to enable handling of X-Forwarded- style headers
|
---|
| 78 | <Call name="addCustomizer">
|
---|
| 79 | <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
|
---|
| 80 | </Call>
|
---|
| 81 | -->
|
---|
| 82 | </New>
|
---|
| 83 |
|
---|
| 84 | <!-- =========================================================== -->
|
---|
| 85 | <!-- RewriteHandle to redirect root to Solr -->
|
---|
| 86 | <!-- =========================================================== -->
|
---|
| 87 | <New id="RewriteHandler" class="org.eclipse.jetty.rewrite.handler.RewriteHandler">
|
---|
| 88 | <Set name="rewriteRequestURI">true</Set>
|
---|
| 89 | <Set name="rewritePathInfo">false</Set>
|
---|
| 90 | <Set name="originalPathAttribute">requestedPath</Set>
|
---|
| 91 |
|
---|
| 92 | <Call name="addRule">
|
---|
| 93 | <Arg>
|
---|
| 94 | <New class="org.eclipse.jetty.rewrite.handler.RedirectRegexRule">
|
---|
| 95 | <Set name="regex">^/$</Set>
|
---|
| 96 | <Set name="replacement">/solr/</Set>
|
---|
| 97 | </New>
|
---|
| 98 | </Arg>
|
---|
| 99 | </Call>
|
---|
| 100 | <Call name="addRule">
|
---|
| 101 | <Arg>
|
---|
| 102 | <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
---|
| 103 | <Set name="pattern">/v2/*</Set>
|
---|
| 104 | <Set name="replacement">/solr/____v2</Set>
|
---|
| 105 | </New>
|
---|
| 106 | </Arg>
|
---|
| 107 | </Call>
|
---|
| 108 | <Call name="addRule">
|
---|
| 109 | <Arg>
|
---|
| 110 | <New class="org.eclipse.jetty.rewrite.handler.RewritePatternRule">
|
---|
| 111 | <Set name="pattern">/api/*</Set>
|
---|
| 112 | <Set name="replacement">/solr/____v2</Set>
|
---|
| 113 | </New>
|
---|
| 114 | </Arg>
|
---|
| 115 | </Call>
|
---|
| 116 | <Set name="handler">
|
---|
| 117 | <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
|
---|
| 118 | <Set name="handlers">
|
---|
| 119 | <Array type="org.eclipse.jetty.server.Handler">
|
---|
| 120 | <Item>
|
---|
| 121 | <New id="Contexts" class="org.eclipse.jetty.server.handler.ContextHandlerCollection"/>
|
---|
| 122 | </Item>
|
---|
| 123 | <Item>
|
---|
| 124 | <New id="InstrumentedHandler" class="com.codahale.metrics.jetty9.InstrumentedHandler">
|
---|
| 125 | <Arg><Ref refid="solrJettyMetricRegistry"/></Arg>
|
---|
| 126 | <Set name="handler">
|
---|
| 127 | <New id="DefaultHandler" class="org.eclipse.jetty.server.handler.DefaultHandler"/>
|
---|
| 128 | </Set>
|
---|
| 129 | </New>
|
---|
| 130 | </Item>
|
---|
| 131 | <Item>
|
---|
| 132 | <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler"/>
|
---|
| 133 | </Item>
|
---|
| 134 | </Array>
|
---|
| 135 | </Set>
|
---|
| 136 | </New>
|
---|
| 137 | </Set>
|
---|
| 138 | </New>
|
---|
| 139 |
|
---|
| 140 | <!-- =========================================================== -->
|
---|
| 141 | <!-- Set handler Collection Structure -->
|
---|
| 142 | <!-- =========================================================== -->
|
---|
| 143 | <Set name="handler">
|
---|
| 144 | <Ref id="RewriteHandler"/>
|
---|
| 145 | </Set>
|
---|
| 146 |
|
---|
| 147 | <!-- =========================================================== -->
|
---|
| 148 | <!-- Configure Request Log -->
|
---|
| 149 | <!-- =========================================================== -->
|
---|
| 150 | <!--
|
---|
| 151 | <Ref id="Handlers">
|
---|
| 152 | <Call name="addHandler">
|
---|
| 153 | <Arg>
|
---|
| 154 | <New id="RequestLog" class="org.eclipse.jetty.server.handler.RequestLogHandler">
|
---|
| 155 | <Set name="requestLog">
|
---|
| 156 | <New id="RequestLogImpl" class="org.eclipse.jetty.server.NCSARequestLog">
|
---|
| 157 | <Set name="filename">
|
---|
| 158 | logs/request.yyyy_mm_dd.log
|
---|
| 159 | </Set>
|
---|
| 160 | <Set name="filenameDateFormat">yyyy_MM_dd</Set>
|
---|
| 161 | <Set name="retainDays">90</Set>
|
---|
| 162 | <Set name="append">true</Set>
|
---|
| 163 | <Set name="extended">false</Set>
|
---|
| 164 | <Set name="logCookies">false</Set>
|
---|
| 165 | <Set name="LogTimeZone">UTC</Set>
|
---|
| 166 | </New>
|
---|
| 167 | </Set>
|
---|
| 168 | </New>
|
---|
| 169 | </Arg>
|
---|
| 170 | </Call>
|
---|
| 171 | </Ref>
|
---|
| 172 | -->
|
---|
| 173 |
|
---|
| 174 | <!-- =========================================================== -->
|
---|
| 175 | <!-- extra options -->
|
---|
| 176 | <!-- =========================================================== -->
|
---|
| 177 | <Set name="stopAtShutdown">true</Set>
|
---|
| 178 | <Set name="dumpAfterStart">false</Set>
|
---|
| 179 | <Set name="dumpBeforeStop">false</Set>
|
---|
| 180 |
|
---|
| 181 | <Call name="addBean">
|
---|
| 182 | <Arg>
|
---|
| 183 | <New id="DeploymentManager" class="org.eclipse.jetty.deploy.DeploymentManager">
|
---|
| 184 | <Set name="contexts">
|
---|
| 185 | <Ref refid="Contexts" />
|
---|
| 186 | </Set>
|
---|
| 187 | <Call name="setContextAttribute">
|
---|
| 188 | <Arg>org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern</Arg>
|
---|
| 189 | <Arg>.*/servlet-api-[^/]*\.jar$</Arg>
|
---|
| 190 | </Call>
|
---|
| 191 |
|
---|
| 192 | <Call name="addAppProvider">
|
---|
| 193 | <Arg>
|
---|
| 194 | <New class="org.eclipse.jetty.deploy.providers.WebAppProvider">
|
---|
| 195 | <Set name="monitoredDirName"><Property name="jetty.base" default="."/>/contexts</Set>
|
---|
| 196 | <Set name="scanInterval">0</Set>
|
---|
| 197 | </New>
|
---|
| 198 | </Arg>
|
---|
| 199 | </Call>
|
---|
| 200 |
|
---|
| 201 | <!-- Add a customize step to the deployment lifecycle -->
|
---|
| 202 | <!-- uncomment and replace DebugBinding with your extended AppLifeCycle.Binding class
|
---|
| 203 | <Call name="insertLifeCycleNode">
|
---|
| 204 | <Arg>deployed</Arg>
|
---|
| 205 | <Arg>starting</Arg>
|
---|
| 206 | <Arg>customise</Arg>
|
---|
| 207 | </Call>
|
---|
| 208 | <Call name="addLifeCycleBinding">
|
---|
| 209 | <Arg>
|
---|
| 210 | <New class="org.eclipse.jetty.deploy.bindings.DebugBinding">
|
---|
| 211 | <Arg>customise</Arg>
|
---|
| 212 | </New>
|
---|
| 213 | </Arg>
|
---|
| 214 | </Call>
|
---|
| 215 | -->
|
---|
| 216 |
|
---|
| 217 | </New>
|
---|
| 218 | </Arg>
|
---|
| 219 | </Call>
|
---|
| 220 |
|
---|
| 221 | <Call name="addBean">
|
---|
| 222 | <Arg>
|
---|
| 223 | <New class="org.eclipse.jetty.security.HashLoginService">
|
---|
| 224 | <Set name="name">HTRC-EF Realm</Set>
|
---|
| 225 | <Set name="config"><SystemProperty name="jetty.home" default="."/>/etc/realm.properties</Set>
|
---|
| 226 | <Set name="refreshInterval">0</Set>
|
---|
| 227 | </New>
|
---|
| 228 | </Arg>
|
---|
| 229 | </Call>
|
---|
| 230 |
|
---|
| 231 | </Configure>
|
---|