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

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:

To restrict by host name:

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