修改conf/tomcat-users.xmlweb
<role rolename="manager"/>apache
<role rolename="manager-gui"/>
<role rolename="admin"/>tomcat
<user username="user" password="password" roles="admin,manager,manager-gui"/>app
同時還須要修改,如無新建conf/Catalina/localhost/manager.xml 內容以下:webapp
<Context privileged="true" antiResourceLocking="false"
docBase="${catalina.home}/webapps/manager">
<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" />
</Context>ui
無須重啓tomcat便可生效。this
引用原文:xml
Each deployed webapp has a context.xml file that lives in $CATALINA_BASE/conf/[enginename]/[hostname] (conf/Catalina/localhost by default) and has the same name as the webapp (manager.xml in this case). If no file is present, default values are used.
So, you need to create a file conf/Catalina/localhost/manager.xml and specify the rule you want to allow remote access.ci