1、首先修改webapps/manager/META-INF下的context.xml文件(一定要把原来的这个节点删掉)
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">或者
docBase="${tomcat_home}/webapps/manager">tomcat的环境变量
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>
2、修改conf目录下的tomcat-user.xml
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="tomcat" password="tomcat" roles="manager-gui,manager-script,manager-jmx,manager-status"/>
3、重启tomcat即可