修改conf/tomcat-users.xml加入:
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="admin"/>
<role rolename="admin-gui"/>
<user username="tomcat" password="fanjinbao" roles="manager,manager-gui,admin,admin-gui"/>
重启后依然提示403的解决办法:
vim 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服务即可生效。