• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 7 - RemoteAddrValve comma separated IP Address Failure

 
Mick Smith
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic