在配置文件tomcat-users.xml中添加如下内容即可。
<role rolename= " admin " /> <role rolename= " manager-script " /> <role rolename= " manager-gui " /> <role rolename= " manager-jmx " /> <role rolename= " manager-status " /> <role rolename= " admin-gui " /> <role rolename= " admin-script " /> <user username= " admin " password= " admin " roles= " manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script " />