aspose file tools*
The moose likes Tomcat and the fly likes Tomcat 7 - RemoteAddrValve  comma separated IP Address Failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 7 - RemoteAddrValve  comma separated IP Address Failure" Watch "Tomcat 7 - RemoteAddrValve  comma separated IP Address Failure" New topic
Author

Tomcat 7 - RemoteAddrValve comma separated IP Address Failure

Mick Smith
Greenhorn

Joined: Dec 10, 2009
Posts: 14
Hi

When I put into my server.xml the line below all works fine & I can access my server from that specified ip address.

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="111\.222\.333\.444" />


However if I want to allow multiple IP Address by seperating with a comma (as per the tomcat 7 docs), say for example like this:

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="111\.222\.333\.444, 127\.0\.0\.1" /> it does NOT work.

This means I cannot access my server from even my localhost machine or the ip address specified.
If I have just 1 entry, it works fine. but multiple entries fail.

any help on this??

thanks!
Josh Grabarek
Greenhorn

Joined: Apr 28, 2011
Posts: 1
I've searched google for about an hour and can't find anyone who will just give a simple answer to this question. I finally found it by accident... in Tomcat 7 it's no longer separated by commas. It's pipe | separated and I didn't have to use any back slashes. Not sure why I'm seeing that everywhere but there is probably a reason.

<Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="192.168.1.3|192.168.1.4" deny="" />
Heath Swanson
Greenhorn

Joined: Mar 31, 2011
Posts: 6
Josh Grabarek wrote: Not sure why I'm seeing that everywhere but there is probably a reason.


Yes, there's a reason. Actually this is a regex form. If not escaped by backslash, a .(dot) matches every single character.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 7 - RemoteAddrValve comma separated IP Address Failure