修改conf/tomcat-users.xml
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<user username="user" password="password" roles="admin,manager,manager-gui"/>
同时还需要修改,如无新建conf/Catalina/localhost/manager.xml 内容如下:
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
无须重启tomcat即可生效。
原文:https://www.cnblogs.com/areyouready/p/8972456.html