一个配置Tomcat IP访问控制的例子
时间:2006-12-08 来源:饮鸩止渴
<Context path="/weba" debug="0" privileged="true" reloadable="true"
docBase="weba">
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="192.168.5.*"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.9.*"/>
</Context> 其实还可以用域名,类似如下: <Context path="/examples" ...>
...
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="*.mycompany.com,www.yourcompany.com"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.1.*"/>
...
</Context>
docBase="weba">
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="192.168.5.*"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.9.*"/>
</Context> 其实还可以用域名,类似如下: <Context path="/examples" ...>
...
<Valve className="org.apache.catalina.valves.RemoteHostValve"
allow="*.mycompany.com,www.yourcompany.com"/>
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
deny="192.168.1.*"/>
...
</Context>
相关阅读 更多 +