解决的方法
1. 添加 Context
http://stackoverflow.com/questions/36703856/access-tomcat-manager-app-from-different-host
在 $tomcathome/conf/Catalina/localhost/下创建 manager.xml , 填入如下内容:
<Context privileged="true" antiResourceLocking="false" docBase="${catalina.home}/webapps/manager"> <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="^.*$" /> </Context>
2. 添加用户:
$tomcathome/conf/tomcat-users.xml 中的 <tomcat-users></tomcat-users>
标签内添加如下代码:
<role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <role rolename="manager-status"/> <role rolename="admin-gui"/> <role rolename="admin-script"/> <user username="admin" password="admin" roles="manager-gui,manager-script,manager-jmx,manager-status,admin-gui,admin-script"/> <user username="deploy" password="deploy" roles="manager-script"/>