1.在tomcat-users.xml文件加上
<role rolename="tomcat"/>
<role rolename="role1"/>
<role rolename="manager-gui"/>
<user username="tomcat" password="123456" roles="tomcat"/>
<user username="both" password="123456" roles="tomcat,role1"/>
<user username="role1" password="123456" roles="role1"/>
<user password="123456" roles="tomcat,role1,manager-gui" username="admin"/>
2.加上这个还不够,要把下面这个注释掉,不然会有
403 Access Denied
把/usr/local/src/apache-tomcat-8.5.23/webapps/manager/META-INF/context.xml里面的