tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanford Stein <Sanford.St...@cybertools.biz>
Subject Re: Denying IPs using the Valve command in context.xml
Date Tue, 04 Oct 2011 19:40:25 GMT
Andre, Christopher, and Konstantin,

Thank you for your prompt responses and your suggestions.

I apologize for not indicating my Tomcat version -- it is 5.5.23.  My OS 
is RHEL 5.6.
I am not intentionally sending HTML e-mails--perhaps my Thunderbird 
client is doing something of which I am unaware.

By escaping my punctuation characters, I was able to get 
"\*\.googlebot\.com"  and other such addresses to work.

I tried to use the filter feature to restrict an IP address to certain 
class files only.  Here is what I put into web.xml:

<filter>
<filter-name>Remote Address Filter</filter-name>
<filter-class>org.apache.catalina.filters.RemoteAddrFilter</filter-class>
<init-param>
<param-name>deny</param-name>
<param-value>24\.13\.86\.5</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Remote Address Filter</filter-name>
<url-pattern>/CyberHTML</url-pattern>
</filter-mapping>
<filter>
<filter-name>Remote Address Filter 2</filter-name>
<filter-class>org.apache.catalina.filters.RemoteAddrFilter</filter-class>
<init-param>
<param-name>allow</param-name>
<param-value>24\.13\.86\.5</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Remote Address Filter 2</filter-name>
<url-pattern>/TunnelServlet</url-pattern>
<filter-mapping>

The result was that 24.13.86.5 was denied access to BOTH servlets.  
(They are both in the 'classes' subdirectory.)  If someone can see 
anything I am doing wrong, I would appreciate your response.

Thanks,
Sanford Stein
CyberTools Inc.



	


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message