vi tomcat/conf/tomcat-users.xml
<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<user username="admin" password="admin" roles="manager-gui,admin-gui,manager-script"/>
注意需要把 /apache-tomcat-9.0.8/webapps/manager/META-INF/context.xml 的代码注释掉