source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/gslis-cluster/CONF/jetty-solr7/web.xml

Last change on this file was 32118, checked in by davidb, 6 years ago

Config files needed to top up Jetty with solr servlet

File size: 7.5 KB
Line 
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 <filter>
49 <filter-name>cross-origin</filter-name>
50 <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
51 <init-param>
52 <param-name>allowedOrigins</param-name>
53 <param-value>*</param-value>
54 </init-param>
55 <init-param>
56 <param-name>allowedMethods</param-name>
57 <param-value>GET,POST,OPTIONS,DELETE,PUT,HEAD</param-value>
58 </init-param>
59 <init-param>
60 <param-name>allowedHeaders</param-name>
61 <param-value>origin,content-type,accept,x-requested-with</param-value>
62 </init-param>
63 </filter>
64
65 <filter-mapping>
66 <filter-name>cross-origin</filter-name>
67 <url-pattern>/*</url-pattern>
68 </filter-mapping>
69
70
71
72 <!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
73 <filter>
74 <filter-name>SolrRequestFilter</filter-name>
75 <filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
76 <!--
77 Exclude patterns is a list of directories that would be short circuited by the
78 SolrDispatchFilter. It includes all Admin UI related static content.
79 NOTE: It is NOT a pattern but only matches the start of the HTTP ServletPath.
80 -->
81 <init-param>
82 <param-name>excludePatterns</param-name>
83 <param-value>/partials/.+,/libs/.+,/css/.+,/js/.+,/img/.+,/tpl/.+</param-value>
84 </init-param>
85 </filter>
86
87 <filter-mapping>
88 <!--
89 NOTE: When using multicore, /admin JSP URLs with a core specified
90 such as /solr/coreName/admin/stats.jsp get forwarded by a
91 RequestDispatcher to /solr/admin/stats.jsp with the specified core
92 put into request scope keyed as "org.apache.solr.SolrCore".
93
94 It is unnecessary, and potentially problematic, to have the SolrDispatchFilter
95 configured to also filter on forwards. Do not configure
96 this dispatcher as <dispatcher>FORWARD</dispatcher>.
97 -->
98 <filter-name>SolrRequestFilter</filter-name>
99 <url-pattern>/*</url-pattern>
100 </filter-mapping>
101
102 <servlet>
103 <servlet-name>LoadAdminUI</servlet-name>
104 <servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>
105 </servlet>
106
107 <!-- Remove in Solr 5.0 -->
108 <!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 -->
109 <servlet>
110 <servlet-name>RedirectOldAdminUI</servlet-name>
111 <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
112 <init-param>
113 <param-name>destination</param-name>
114 <param-value>${context}/#/</param-value>
115 </init-param>
116 </servlet>
117
118 <servlet>
119 <servlet-name>RedirectOldZookeeper</servlet-name>
120 <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
121 <init-param>
122 <param-name>destination</param-name>
123 <param-value>${context}/admin/zookeeper</param-value>
124 </init-param>
125 </servlet>
126
127 <servlet>
128 <servlet-name>RedirectLogging</servlet-name>
129 <servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
130 <init-param>
131 <param-name>destination</param-name>
132 <param-value>${context}/#/~logging</param-value>
133 </init-param>
134 </servlet>
135
136 <servlet>
137 <servlet-name>SolrRestApi</servlet-name>
138 <servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
139 <init-param>
140 <param-name>org.restlet.application</param-name>
141 <param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value>
142 </init-param>
143 </servlet>
144
145 <servlet-mapping>
146 <servlet-name>RedirectOldAdminUI</servlet-name>
147 <url-pattern>/admin/</url-pattern>
148 </servlet-mapping>
149 <servlet-mapping>
150 <servlet-name>RedirectOldAdminUI</servlet-name>
151 <url-pattern>/admin</url-pattern>
152 </servlet-mapping>
153 <servlet-mapping>
154 <servlet-name>RedirectOldZookeeper</servlet-name>
155 <url-pattern>/zookeeper.jsp</url-pattern>
156 </servlet-mapping>
157 <servlet-mapping>
158 <servlet-name>RedirectOldZookeeper</servlet-name>
159 <url-pattern>/zookeeper</url-pattern>
160 </servlet-mapping>
161 <servlet-mapping>
162 <servlet-name>RedirectLogging</servlet-name>
163 <url-pattern>/logging</url-pattern>
164 </servlet-mapping>
165
166 <servlet-mapping>
167 <servlet-name>LoadAdminUI</servlet-name>
168 <url-pattern>/index.html</url-pattern>
169 </servlet-mapping>
170
171 <servlet-mapping>
172 <servlet-name>SolrRestApi</servlet-name>
173 <url-pattern>/schema/*</url-pattern>
174 </servlet-mapping>
175
176 <mime-mapping>
177 <extension>.xsl</extension>
178 <!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
179 <mime-type>application/xslt+xml</mime-type>
180 </mime-mapping>
181
182 <welcome-file-list>
183 <welcome-file>index.html</welcome-file>
184 </welcome-file-list>
185
186 <!-- Get rid of error message -->
187 <security-constraint>
188 <web-resource-collection>
189 <web-resource-name>Disable TRACE</web-resource-name>
190 <url-pattern>/</url-pattern>
191 <http-method>TRACE</http-method>
192 </web-resource-collection>
193 <auth-constraint/>
194 </security-constraint>
195 <security-constraint>
196 <web-resource-collection>
197 <web-resource-name>Enable everything but TRACE</web-resource-name>
198 <url-pattern>/</url-pattern>
199 <http-method-omission>TRACE</http-method-omission>
200 </web-resource-collection>
201 </security-constraint>
202
203
204 <security-constraint>
205 <web-resource-collection>
206 <web-resource-name>Secured area</web-resource-name>
207 <url-pattern>/index.html</url-pattern>
208 </web-resource-collection>
209 <auth-constraint>
210 <role-name>admin</role-name>
211 </auth-constraint>
212 </security-constraint>
213
214 <login-config>
215 <auth-method>BASIC</auth-method>
216 <realm-name>HTRC-EF Realm</realm-name>
217 </login-config>
218 <security-role>
219 <role-name>admin</role-name>
220 </security-role>
221
222</web-app>
Note: See TracBrowser for help on using the repository browser.