31 Aug 2010
I've recently done a proof of concept using RabbitMQ, Spring AMQP and Spring Integration. This...
21 Jul 2010
In over ten years of experience building software, there are patterns and nuances that you...
13 Jul 2010
I set out to find an elegant solution to providing growl notifications for a JRuby...
05 May 2010
I've started playing around with Heroku lately and ran into an issue when I created...
30 Apr 2010
I've been meaning to investigate something that came to mind a while back and just...

Restricting Access to Tomcat via IP Address or Hostname

Published: 05 Nov 2008

To restrict access to a standalone Tomcat instance by IP address:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127.0.0.1"/>

The above will restrict access to the surrounding Engine, Host, or Context element in TOMCAT_HOME/conf/server.xml. You may also specify a comma separated list of IP addresses instead of a single address.

If you want to deny access to one or more IP addresses, you would do something like this:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" deny="127.0.0.1"/>

To restrict by host name:

<Valve className="org.apache.catalina.valves.RemoteHostValve" allow="yahoo.com"/>

You use the same allow or deny attributes and the RemoteHostValve class instead of RemoteAddrValve.


blog comments powered by Disqus