context元素添加

<Context>

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1" deny=""/>
</Context>

若不加allow默认限制所有ip访问

tomcat限制ip访问

 

若不加<Value>元素默认不限制ip

 

tomcat限制ip访问

 

 

context.xml中<t0omcat-users>节点添加

<role rolename="tomcat"/><!-- 普通角色 -->
<role rolename="role1"/><!-- 普通角色 -->
<role rolename="manager-gui"/><!-- 允许manager-app -->
<role rolename="admin-gui"/><!-- 允许host-manager,server status -->
<user username="both" password="tomcat" roles="tomcat,role1,manager-gui,admin-gui"/>
<user username="role1" password="tomcat" roles="role1"/>
View Code

相关文章:

  • 2021-10-25
  • 2022-12-23
  • 2021-10-13
  • 2022-01-04
  • 2021-07-16
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2021-11-06
  • 2021-11-16
相关资源
相似解决方案