添加tomcat管理用户的方法,在tomct-users.xmld的users节点下添加如下代码:
添加一个角色 manager-gui, 分配给用户tomcat该角色。
Note that for Tomcat 6.0.30 onwards, the roles required to use the manager application were changed from the single manager role to add the following four roles. (The manager role is still available but should not be used as it avoids the CSRF protection). You will need to assign the role(s) required for the functionality you wish to access.
tomcat的角色类型:
manager-gui - allows access to the HTML GUI and the status pages
manager-script - 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 status pages only
注意事项:
The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:
users with the manager-gui role should not be granted either the manager-script or manager-jmx roles.
if the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.