开发者

Tomcat6 : a way to apply a "global" accept/reject IP filter?

开发者 https://www.devze.com 2023-04-10 15:09 出处:网络
I\'ve got a开发者_JS百科 tomcat6 servlet container which runs various applications, such as solr. I\'d like to be able to specify which IP addresses that are allowed to access the server. Is there a w

I've got a开发者_JS百科 tomcat6 servlet container which runs various applications, such as solr. I'd like to be able to specify which IP addresses that are allowed to access the server. Is there a way to "globally", for all servlets, to specify which IP adresses that can access any of the servlets?


I solved it by editing the servlet context.xml file. Event though it isn't a "global" solution, it did the track and allows me to filter access by IP address.

<?xml version="1.0" encoding="UTF-8"?>
<Context antiJARLocking="true">
    <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="[IPADDRESS]"/>
</Context>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号