tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Denying IPs using the Valve command in context.xml
Date Tue, 04 Oct 2011 20:41:26 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sanford,

On 10/4/2011 3:40 PM, Sanford Stein wrote:
> I am not intentionally sending HTML e-mails--perhaps my
> Thunderbird client is doing something of which I am unaware.

You can configure tb to send plain-text to certain recipients.
Consider adding users@tomcat.apache.org to such a list.

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

Good.

> 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.

Note that you have mapped the filters by URL and not by servlet. If
you want to map by servlet and not by URL, you can use <servlet-name>
instead of <url-mapping>.

I can't explain why you are getting denials under both URLs, though.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6Lb3YACgkQ9CaO5/Lv0PDf8gCbBoE2/LpouKwuWH5hzFTzMy2R
makAn2xT/0Dq9E4nopGLpPZ9E36abgs6
=HV8Y
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message