blob: 101b463a6854d1bf15c2c005ea786723d15c8167 [file] [log] [blame]
Hongqing Liufd5ee812014-05-10 16:32:51 +08001<?xml version="1.0" encoding="ISO-8859-1"?>
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
19<web-app xmlns="http://java.sun.com/xml/ns/javaee"
20 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
22 version="2.5">
23
24 <display-name>Tomcat Manager Application</display-name>
25 <description>
26 A scriptable management web application for the Tomcat Web Server;
27 Manager lets you view, load/unload/etc particular web applications.
28 </description>
29
30 <servlet>
31 <servlet-name>HostManager</servlet-name>
32 <servlet-class>org.apache.catalina.manager.host.HostManagerServlet</servlet-class>
33 <init-param>
34 <param-name>debug</param-name>
35 <param-value>2</param-value>
36 </init-param>
37 </servlet>
38 <servlet>
39 <servlet-name>HTMLHostManager</servlet-name>
40 <servlet-class>org.apache.catalina.manager.host.HTMLHostManagerServlet</servlet-class>
41 <init-param>
42 <param-name>debug</param-name>
43 <param-value>2</param-value>
44 </init-param>
45 </servlet>
46
47 <!-- Define the Manager Servlet Mapping -->
48 <servlet-mapping>
49 <servlet-name>HostManager</servlet-name>
50 <url-pattern>/list</url-pattern>
51 </servlet-mapping>
52 <servlet-mapping>
53 <servlet-name>HostManager</servlet-name>
54 <url-pattern>/add</url-pattern>
55 </servlet-mapping>
56 <servlet-mapping>
57 <servlet-name>HostManager</servlet-name>
58 <url-pattern>/remove</url-pattern>
59 </servlet-mapping>
60 <servlet-mapping>
61 <servlet-name>HostManager</servlet-name>
62 <url-pattern>/start</url-pattern>
63 </servlet-mapping>
64 <servlet-mapping>
65 <servlet-name>HostManager</servlet-name>
66 <url-pattern>/stop</url-pattern>
67 </servlet-mapping>
68 <servlet-mapping>
69 <servlet-name>HTMLHostManager</servlet-name>
70 <url-pattern>/html/*</url-pattern>
71 </servlet-mapping>
72
73 <filter>
74 <filter-name>CSRF</filter-name>
75 <filter-class>org.apache.catalina.filters.CsrfPreventionFilter</filter-class>
76 <init-param>
77 <param-name>entryPoints</param-name>
78 <param-value>/html,/html/list</param-value>
79 </init-param>
80 </filter>
81
82 <filter-mapping>
83 <filter-name>CSRF</filter-name>
84 <servlet-name>HTMLHostManager</servlet-name>
85 </filter-mapping>
86
87 <!-- Define a Security Constraint on this Application -->
88 <security-constraint>
89 <web-resource-collection>
90 <web-resource-name>HostManager commands</web-resource-name>
91 <url-pattern>/list</url-pattern>
92 <url-pattern>/add</url-pattern>
93 <url-pattern>/remove</url-pattern>
94 <url-pattern>/start</url-pattern>
95 <url-pattern>/stop</url-pattern>
96 </web-resource-collection>
97 <auth-constraint>
98 <!-- NOTE: 1. These roles are not present in the default users file
99 2. The admin role is deprecated, it will be removed in
100 Tomcat 7.
101 3. Use the admin-script role to take advantage of the new
102 CSRF protection. Using the admin role or assigning both
103 the admin-script and admin-gui roles to the same user
104 will bypass the CSRF protection. -->
105 <role-name>admin</role-name>
106 <role-name>admin-script</role-name>
107 </auth-constraint>
108 </security-constraint>
109
110 <security-constraint>
111 <web-resource-collection>
112 <web-resource-name>HTMLHostManager commands</web-resource-name>
113 <url-pattern>/html/*</url-pattern>
114 </web-resource-collection>
115 <auth-constraint>
116 <!-- NOTE: 1. These roles are not present in the default users file
117 2. The admin role is deprecated, it will be removed in
118 Tomcat 7.
119 3. Use the admin-gui role to take advantage of the new
120 CSRF protection. Using the admin role or assigning both
121 the admin-script and admin-gui roles to the same user
122 will bypass the CSRF protection. -->
123 <role-name>admin</role-name>
124 <role-name>admin-gui</role-name>
125 </auth-constraint>
126 </security-constraint>
127
128 <!-- Define the Login Configuration for this Application -->
129 <login-config>
130 <auth-method>BASIC</auth-method>
131 <realm-name>Tomcat Host Manager Application</realm-name>
132 </login-config>
133
134 <!-- Security roles referenced by this web application -->
135 <security-role>
136 <description>
137 The role that is required to access the text Host Manager pages
138 </description>
139 <role-name>admin-script</role-name>
140 </security-role>
141 <security-role>
142 <description>
143 The role that is required to access the HTML Host Manager pages
144 </description>
145 <role-name>admin-gui</role-name>
146 </security-role>
147 <security-role>
148 <description>
149 Deprecated role that can access all Host Manager functionality
150 </description>
151 <role-name>admin</role-name>
152 </security-role>
153
154 <error-page>
155 <error-code>401</error-code>
156 <location>/WEB-INF/jsp/401.jsp</location>
157 </error-page>
158 <error-page>
159 <error-code>403</error-code>
160 <location>/WEB-INF/jsp/403.jsp</location>
161 </error-page>
162
163</web-app>