Tomcat中限制ip访问

十二月 26th, 2009 Posted in Tomcat | 阅读次数: 1,180 次

Author:gaojinbo

Time:2009-12-26

Tomcat中限制ip访问是非常简单的,只需要编辑server.xml文件即可

vi server.xml

找到context区域,如

<context path=”/gaojinbo”  reloadable=”true” docBase=”/opt/www/gaojinbo”>

<value className=”org.apache.catalina.values.RemoteAddrValue” allow=”" deny=”127.0.0.1″ />

</context>

说明:只限制127.0.0.1访问

如要限制192.168.1.0-192.168.5.255和192.168.10.0-192.168.15.255

deny=”192.168.[1-5].*,192.168.[10-15].*”

完成!

相关日志:

Tags:

4 Responses to “Tomcat中限制ip访问”

  1. banquet dresses Says:

    Cooler sites…

    [...]we came across a cool web-site which you could delight in. Take a look for those who want[...]……


  2. smilence Says:

    最近我也遇到这个问题,有个外国ip恶意提交评论,想给他ip屏蔽了,在Tomcat加配置这个方法不爽吧,如果要增加一个ip咋办,还得ftp进入空间修改配置文件,太麻烦了


  3. tandarts almere haven Says:

    [...]the time to read or visit the content or sites we have linked to below the[...]……

    [...]here are some links to sites that we link to because we think they are worth visiting[...]……


  4. car injury compensation Says:

    [...]The information mentioned in the article are some of the best available [...]……

    [...]below you’ll find the link to some sites that we think you should visit[...]……


留下您的脚印