From: markt Date: Mon, 21 Sep 2009 22:31:47 +0000 (+0000) Subject: Separate out Manager app roles X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f2f63334e98d93cef115a6e0b40f8ff8da5606fb;p=tomcat7.0 Separate out Manager app roles Move /manager to /manager/text to simplify permissions Allows the future addition of extra security measures to one interface that might not make sense for another (usually these will be added to the HTML interface but that might not always be the case). git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@817446 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index c3c81bc8c..a1a005596 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -182,12 +182,17 @@ - + - 631321 Update changelog to support the <rev> element. - (fhanik) + 631321 Update changelog to support the <rev> element + in the documentation. (fhanik) + + A number of additional roles were added to the Manager application to + separate out permissions for the HTML interface, the text interface and + the JMX proxy. (markt) + diff --git a/webapps/docs/manager-howto.xml b/webapps/docs/manager-howto.xml index 3b0ff1f0c..b631bc4e4 100644 --- a/webapps/docs/manager-howto.xml +++ b/webapps/docs/manager-howto.xml @@ -211,7 +211,7 @@ an example of restricting access to the localhost by IP address:

All commands that the Manager application knows how to process are specified in a single request URI like this:

-http://{host}:{port}/manager/{command}?{parameters} +http://{host}:{port}/manager/text/{command}?{parameters}

where {host} and {port} represent the hostname and port number on which Tomcat is running, {command} @@ -270,7 +270,7 @@ version of the messages.

-http://localhost:8080/manager/deploy?path=/foo +http://localhost:8080/manager/text/deploy?path=/foo

Upload the web application archive (WAR) file that is specified as the @@ -343,7 +343,7 @@ has been deployed using the tag attribute. Note that the work directory for the manager webapp will contain the previously deployed WARs; removing it would make the deployment fail. -http://localhost:8080/manager/deploy?path=/footoo&tag=footag +http://localhost:8080/manager/text/deploy?path=/footoo&tag=footag

@@ -362,7 +362,7 @@ the entire WAR file.

/path/to/foo on the Tomcat server is deployed as the web application context named /footoo. -http://localhost:8080/manager/deploy?path=/footoo&war=file:/path/to/foo +http://localhost:8080/manager/text/deploy?path=/footoo&war=file:/path/to/foo

@@ -372,7 +372,7 @@ Tomcat server is deployed as the web application context named so the context path defaults to the name of the web application archive file without the ".war" extension. -http://localhost:8080/manager/deploy?war=jar:file:/path/to/bar.war!/ +http://localhost:8080/manager/text/deploy?war=jar:file:/path/to/bar.war!/

@@ -387,7 +387,7 @@ extension is used as the path.

deployed as the web application context named /foo. Notice that the context path used is the name of the web application directory. -http://localhost:8080/manager/deploy?war=foo +http://localhost:8080/manager/text/deploy?war=foo

@@ -395,7 +395,7 @@ http://localhost:8080/manager/deploy?war=foo Host appBase directory on the Tomcat server is deployed as the web application context named /bar. -http://localhost:8080/manager/deploy?war=bar.war +http://localhost:8080/manager/text/deploy?war=bar.war

@@ -430,7 +430,7 @@ docBase configured in the context configuration ".xml" file.

Here is an example of deploying an application using a Context configuration ".xml" file. -http://localhost:8080/manager/deploy?config=file:/path/context.xml +http://localhost:8080/manager/text/deploy?config=file:/path/context.xml

@@ -438,7 +438,7 @@ http://localhost:8080/manager/deploy?config=file:/path/context.xml configuration ".xml" file and a web application ".war" file located on the server. -http://localhost:8080/manager/deploy?config=file:/path/context.xml&war=jar:file:/path/bar.war!/ +http://localhost:8080/manager/text/deploy?config=file:/path/context.xml&war=jar:file:/path/bar.war!/

@@ -529,7 +529,7 @@ error message. Possible causes for problems include:

-http://localhost:8080/manager/list +http://localhost:8080/manager/text/list

List the context paths, current status (running or @@ -549,7 +549,7 @@ OK - Listed applications for virtual host localhost -http://localhost:8080/manager/reload?path=/examples +http://localhost:8080/manager/text/reload?path=/examples

Signal an existing application to shut itself down and reload. This can @@ -608,7 +608,7 @@ error message. Possible causes for problems include:

-http://localhost:8080/manager/serverinfo +http://localhost:8080/manager/text/serverinfo

Lists information about the Tomcat version, OS, and JVM properties.

@@ -628,7 +628,7 @@ include an error message. Possible causes for problems include:

-http://localhost:8080/manager/resources[?type=xxxxx] +http://localhost:8080/manager/text/resources[?type=xxxxx]

List the global JNDI resources that are available for use in resource @@ -680,7 +680,7 @@ include an error message. Possible causes for problems include:

-http://localhost:8080/manager/roles +http://localhost:8080/manager/text/roles

List the security role names (and corresponding descriptions) that are @@ -733,7 +733,7 @@ include an error message. Possible causes for problems include:

-http://localhost:8080/manager/sessions?path=/examples +http://localhost:8080/manager/text/sessions?path=/examples

Display the default session timeout for a web application, and the @@ -753,7 +753,7 @@ Default maximum session inactive interval 30 minutes -http://localhost:8080/manager/start?path=/examples +http://localhost:8080/manager/text/start?path=/examples

Signal a stopped application to restart, and make itself available again. @@ -796,7 +796,7 @@ error message. Possible causes for problems include:

-http://localhost:8080/manager/stop?path=/examples +http://localhost:8080/manager/text/stop?path=/examples

Signal an existing application to make itself unavailable, but leave it @@ -839,7 +839,7 @@ error message. Possible causes for problems include:

-http://localhost:8080/manager/undeploy?path=/examples +http://localhost:8080/manager/text/undeploy?path=/examples

WARNING - This command will delete any web @@ -928,7 +928,7 @@ file might look something like this:

<property name="path" value="/myapp"/> <!-- Configure properties to access the Manager application --> - <property name="url" value="http://localhost:8080/manager"/> + <property name="url" value="http://localhost:8080/manager/text"/> <property name="username" value="myusername"/> <property name="password" value="mypassword"/> diff --git a/webapps/manager/401.jsp b/webapps/manager/401.jsp index fb45a1bd9..ab1721d85 100644 --- a/webapps/manager/401.jsp +++ b/webapps/manager/401.jsp @@ -35,17 +35,33 @@ You are not authorized to view this page. If you have not changed any configuration files, please examine the file conf/tomcat-users.xml in your installation. That - file will contain the credentials to let you use this webapp. + file must contain the credentials to let you use this webapp.

- You will need to add manager role to the config file listed above. - For example: + For example, to add the manager role to a user named + tomcat with a password of s3cret, add the following to the + config file listed above.

 <role rolename="manager"/>
 <user username="tomcat" password="s3cret" roles="manager"/>
 

+ Note that for Tomcat 7 onwards, the roles required to use the manager + application were changed from the single manager role to the + following four roles. You will need to assign the role(s) required for + the functionality you wish to access. +

    +
  • manager - allows access to the HTML GUI and the status + pages
  • +
  • manager-scripts - allows access to the text interface and the + status pages
  • +
  • manager-jmx - allows access to the JMX proxy and the status + pages
  • +
  • manager-status - allows access to the just status pages
  • +
+

+

For more information - please see the Manager App HOW-TO.

diff --git a/webapps/manager/404.jsp b/webapps/manager/404.jsp new file mode 100644 index 000000000..661bb67ae --- /dev/null +++ b/webapps/manager/404.jsp @@ -0,0 +1,59 @@ + +<%@ page import="org.apache.catalina.util.RequestUtil" %> + + + 404 Not found + + + +

404 Not found

+

+ The page you tried to access + (<%=RequestUtil.filter((String) request.getAttribute( + "javax.servlet.error.request_uri"))%>) + does not exist. +

+

+ The Manager application has been re-structured for Tomcat 7 onwards and some + of URLs have changed. All URLs used to access the Manager application should + now start with one of the following options: +

    +
  • <%=request.getContextPath()%>/html for the HTML GUI
  • +
  • <%=request.getContextPath()%>/text for the text interface
  • +
  • <%=request.getContextPath()%>/jmxproxy for the JMX proxy
  • +
  • <%=request.getContextPath()%>/status for the status pages
  • +
+ Note that the URL for the text interface has changed from + "<%=request.getContextPath()%>" to + "<%=request.getContextPath()%>/text". +

+

+ You probably need to adjust the URL you are using to access the Manager + application. However, there is always a chance you have found a bug in the + Manager application. If you are sure you have found a bug, and that the bug + has not already been reported, please report it to the Apache Tomcat team. +

+ + diff --git a/webapps/manager/WEB-INF/web.xml b/webapps/manager/WEB-INF/web.xml index a067f212c..ff19a2071 100644 --- a/webapps/manager/WEB-INF/web.xml +++ b/webapps/manager/WEB-INF/web.xml @@ -27,12 +27,6 @@ Manager lets you view, load/unload/etc particular web applications. - Manager org.apache.catalina.manager.ManagerServlet @@ -66,59 +60,7 @@ Manager - /list - - - Manager - /expire - - - Manager - /sessions - - - Manager - /start - - - Manager - /stop - - - Manager - /install - - - Manager - /remove - - - Manager - /deploy - - - Manager - /undeploy - - - Manager - /reload - - - Manager - /save - - - Manager - /serverinfo - - - Manager - /roles - - - Manager - /resources + /text/* Status @@ -148,30 +90,44 @@ + - HTMLManger and Manager command - /jmxproxy/* + HTML Manger interface (for humans) /html/* - /list - /expire - /sessions - /start - /stop - /install - /remove - /deploy - /undeploy - /reload - /save - /serverinfo + + + manager + + + + + Text Manger interface (for scripts) + /text/* + + + manager-scripts + + + + + JMX Proxy interface + /jmxproxy/* + + + manager-jmx + + + + + Status interface /status/* - /roles - /resources - manager + manager-scripts + manager-jmx + manager-status @@ -184,14 +140,36 @@ - The role that is required to log in to the Manager Application + The role that is required to access the HTML Manager pages manager + + + The role that is required to access the text Manager pages + + manager-scripts + + + + The role that is required to access the HTML JMX Proxy + + manager-jmx + + + + The role that is required to access to the Manager Status pages + + manager-status + 401 /401.jsp + + 404 + /404.jsp +