|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | + Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 | + contributor license agreements. See the NOTICE file distributed with |
| 5 | + this work for additional information regarding copyright ownership. |
| 6 | + The ASF licenses this file to You under the Apache License, Version 2.0 |
| 7 | + (the "License"); you may not use this file except in compliance with |
| 8 | + the License. You may obtain a copy of the License at |
| 9 | +
|
| 10 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +
|
| 12 | + Unless required by applicable law or agreed to in writing, software |
| 13 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + See the License for the specific language governing permissions and |
| 16 | + limitations under the License. |
| 17 | +--> |
| 18 | +<web-app xmlns="http://java.sun.com/xml/ns/javaee" |
| 19 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 20 | + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" |
| 21 | + version="2.5" |
| 22 | + metadata-complete="true" |
| 23 | +> |
| 24 | + |
| 25 | + |
| 26 | + <!-- Uncomment if you are trying to use a Resin version before 3.0.19. |
| 27 | + Their XML implementation isn't entirely compatible with Xerces. |
| 28 | + Below are the implementations to use with Sun's JVM. |
| 29 | + <system-property javax.xml.xpath.XPathFactory= |
| 30 | + "com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/> |
| 31 | + <system-property javax.xml.parsers.DocumentBuilderFactory= |
| 32 | + "com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/> |
| 33 | + <system-property javax.xml.parsers.SAXParserFactory= |
| 34 | + "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/> |
| 35 | + --> |
| 36 | + |
| 37 | + <!-- People who want to hardcode their "Solr Home" directly into the |
| 38 | + WAR File can set the JNDI property here... |
| 39 | + --> |
| 40 | + <!-- |
| 41 | + <env-entry> |
| 42 | + <env-entry-name>solr/home</env-entry-name> |
| 43 | + <env-entry-value>/put/your/solr/home/here</env-entry-value> |
| 44 | + <env-entry-type>java.lang.String</env-entry-type> |
| 45 | + </env-entry> |
| 46 | + --> |
| 47 | + |
| 48 | + <!-- Enable CORS --> |
| 49 | + <filter> |
| 50 | + <filter-name>cross-origin</filter-name> |
| 51 | + <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class> |
| 52 | + <init-param> |
| 53 | + <param-name>allowedOrigins</param-name> |
| 54 | + <param-value>http://127.0.0.1*,http://localhost*</param-value> |
| 55 | + </init-param> |
| 56 | + <init-param> |
| 57 | + <param-name>allowedMethods</param-name> |
| 58 | + <param-value>GET,POST,DELETE,PUT,HEAD,OPTIONS</param-value> |
| 59 | + </init-param> |
| 60 | + <init-param> |
| 61 | + <param-name>allowedHeaders</param-name> |
| 62 | + <param-value>origin, content-type, cache-control, accept, options, authorization, x-requested-with</param-value> |
| 63 | + </init-param> |
| 64 | + <init-param> |
| 65 | + <param-name>supportsCredentials</param-name> |
| 66 | + <param-value>true</param-value> |
| 67 | + </init-param> |
| 68 | + <init-param> |
| 69 | + <param-name>chainPreflight</param-name> |
| 70 | + <param-value>false</param-value> |
| 71 | + </init-param> |
| 72 | + </filter> |
| 73 | + |
| 74 | + <filter-mapping> |
| 75 | + <filter-name>cross-origin</filter-name> |
| 76 | + <url-pattern>/*</url-pattern> |
| 77 | + </filter-mapping> |
| 78 | + |
| 79 | + <!-- Any path (name) registered in solrconfig.xml will be sent to that filter --> |
| 80 | + <filter> |
| 81 | + <filter-name>SolrRequestFilter</filter-name> |
| 82 | + <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class> |
| 83 | + <!-- |
| 84 | + Exclude patterns is a list of directories that would be short circuited by the |
| 85 | + SolrDispatchFilter. It includes all Admin UI related static content. |
| 86 | + NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath. |
| 87 | + --> |
| 88 | + <init-param> |
| 89 | + <param-name>excludePatterns</param-name> |
| 90 | + <param-value>/css/.+,/js/.+,/img/.+,/tpl/.+</param-value> |
| 91 | + </init-param> |
| 92 | + </filter> |
| 93 | + |
| 94 | + <filter-mapping> |
| 95 | + <!-- |
| 96 | + NOTE: When using multicore, /admin JSP URLs with a core specified |
| 97 | + such as /solr/coreName/admin/stats.jsp get forwarded by a |
| 98 | + RequestDispatcher to /solr/admin/stats.jsp with the specified core |
| 99 | + put into request scope keyed as "org.apache.solr.SolrCore". |
| 100 | +
|
| 101 | + It is unnecessary, and potentially problematic, to have the SolrDispatchFilter |
| 102 | + configured to also filter on forwards. Do not configure |
| 103 | + this dispatcher as <dispatcher>FORWARD</dispatcher>. |
| 104 | + --> |
| 105 | + <filter-name>SolrRequestFilter</filter-name> |
| 106 | + <url-pattern>/*</url-pattern> |
| 107 | + </filter-mapping> |
| 108 | + |
| 109 | + <servlet> |
| 110 | + <servlet-name>LoadAdminUI</servlet-name> |
| 111 | + <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class> |
| 112 | + </servlet> |
| 113 | + |
| 114 | + <!-- Remove in Solr 5.0 --> |
| 115 | + <!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 --> |
| 116 | + <servlet> |
| 117 | + <servlet-name>RedirectOldAdminUI</servlet-name> |
| 118 | + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> |
| 119 | + <init-param> |
| 120 | + <param-name>destination</param-name> |
| 121 | + <param-value>${context}/#/</param-value> |
| 122 | + </init-param> |
| 123 | + </servlet> |
| 124 | + |
| 125 | + <servlet> |
| 126 | + <servlet-name>RedirectOldZookeeper</servlet-name> |
| 127 | + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> |
| 128 | + <init-param> |
| 129 | + <param-name>destination</param-name> |
| 130 | + <param-value>${context}/admin/zookeeper</param-value> |
| 131 | + </init-param> |
| 132 | + </servlet> |
| 133 | + |
| 134 | + <servlet> |
| 135 | + <servlet-name>RedirectLogging</servlet-name> |
| 136 | + <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class> |
| 137 | + <init-param> |
| 138 | + <param-name>destination</param-name> |
| 139 | + <param-value>${context}/#/~logging</param-value> |
| 140 | + </init-param> |
| 141 | + </servlet> |
| 142 | + |
| 143 | + <servlet> |
| 144 | + <servlet-name>SolrRestApi</servlet-name> |
| 145 | + <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class> |
| 146 | + <init-param> |
| 147 | + <param-name>org.restlet.application</param-name> |
| 148 | + <param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value> |
| 149 | + </init-param> |
| 150 | + </servlet> |
| 151 | + |
| 152 | + <servlet-mapping> |
| 153 | + <servlet-name>RedirectOldAdminUI</servlet-name> |
| 154 | + <url-pattern>/admin/</url-pattern> |
| 155 | + </servlet-mapping> |
| 156 | + <servlet-mapping> |
| 157 | + <servlet-name>RedirectOldAdminUI</servlet-name> |
| 158 | + <url-pattern>/admin</url-pattern> |
| 159 | + </servlet-mapping> |
| 160 | + <servlet-mapping> |
| 161 | + <servlet-name>RedirectOldZookeeper</servlet-name> |
| 162 | + <url-pattern>/zookeeper.jsp</url-pattern> |
| 163 | + </servlet-mapping> |
| 164 | + <servlet-mapping> |
| 165 | + <servlet-name>RedirectOldZookeeper</servlet-name> |
| 166 | + <url-pattern>/zookeeper</url-pattern> |
| 167 | + </servlet-mapping> |
| 168 | + <servlet-mapping> |
| 169 | + <servlet-name>RedirectLogging</servlet-name> |
| 170 | + <url-pattern>/logging</url-pattern> |
| 171 | + </servlet-mapping> |
| 172 | + |
| 173 | + <servlet-mapping> |
| 174 | + <servlet-name>LoadAdminUI</servlet-name> |
| 175 | + <url-pattern>/old.html</url-pattern> |
| 176 | + </servlet-mapping> |
| 177 | + |
| 178 | + <servlet-mapping> |
| 179 | + <servlet-name>LoadAdminUI</servlet-name> |
| 180 | + <url-pattern>/index.html</url-pattern> |
| 181 | + </servlet-mapping> |
| 182 | + |
| 183 | + <servlet-mapping> |
| 184 | + <servlet-name>SolrRestApi</servlet-name> |
| 185 | + <url-pattern>/schema/*</url-pattern> |
| 186 | + </servlet-mapping> |
| 187 | + |
| 188 | + <mime-mapping> |
| 189 | + <extension>.xsl</extension> |
| 190 | + <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ --> |
| 191 | + <mime-type>application/xslt+xml</mime-type> |
| 192 | + </mime-mapping> |
| 193 | + |
| 194 | + <welcome-file-list> |
| 195 | + <welcome-file>index.html</welcome-file> |
| 196 | + </welcome-file-list> |
| 197 | + |
| 198 | + <!-- Get rid of error message --> |
| 199 | + <security-constraint> |
| 200 | + <web-resource-collection> |
| 201 | + <web-resource-name>Disable TRACE</web-resource-name> |
| 202 | + <url-pattern>/</url-pattern> |
| 203 | + <http-method>TRACE</http-method> |
| 204 | + </web-resource-collection> |
| 205 | + <auth-constraint/> |
| 206 | + </security-constraint> |
| 207 | + <security-constraint> |
| 208 | + <web-resource-collection> |
| 209 | + <web-resource-name>Enable everything but TRACE</web-resource-name> |
| 210 | + <url-pattern>/</url-pattern> |
| 211 | + <http-method-omission>TRACE</http-method-omission> |
| 212 | + </web-resource-collection> |
| 213 | + </security-constraint> |
| 214 | + |
| 215 | +</web-app> |
0 commit comments