source: other-projects/hathitrust/wcsa/extracted-features-solr/trunk/web-portal/WEB-INF/web.xml@ 31626

Last change on this file since 31626 was 31626, checked in by davidb, 7 years ago

Links to blog entries added

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