You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Propes, Barry L " <ba...@citi.com> on 2010/05/24 19:41:50 UTC

Remote Host Filter

Hello,

I'm trying to implement the RemoteHostValve into my app configuration and getting a forbidden.

In my META-INF/context.xml file in the manager folder, I changed from a RemoteAddrValve, filtered by IP address (which worked successfully) to the RemoteHostValve, using allow="\\machine43name<file://\\machine43name>" (machine43name as an alpha-numeric example).
Our machine names are a mixture of alpha-numeric characters.

I've looked in the logs but not seen anything discernable there.

I looked up the regular expression syntax and thought I was doing this correctly. Has anyone else used this before with success? Any insight or tip as to where I'm going wrong would be greatly appreciated.

I'm using Tomcat 6.0.26, JDK 1.6.0_18 on Win XP Pro.

Thanks,

Barry



RE: Remote Host Filter

Posted by "Propes, Barry L " <ba...@citi.com>.
I believe that's my problem, there.

A few years back I tried to use both .getRemoteAddr and .getRemoteHost in one of my servlets to retrieve those user agent variables (both IP and machine names), and both returned the IP address.

So I'm probably stuck using the RemoteAddrValve filter.

Thanks, though. 

-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Monday, May 24, 2010 1:58 PM
To: Tomcat Users List
Subject: RE: Remote Host Filter

> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
> Subject: RE: Remote Host Filter
> 
> <Valve className="org.apache.catalina.valves.RemoteHostValve"
> allow="\\machine43name" />     like this.

As Mark said, use the actual name as it appears in the HTTP header, not the Windows corruption of it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


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


RE: Remote Host Filter

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
> Subject: RE: Remote Host Filter
> 
> <Valve className="org.apache.catalina.valves.RemoteHostValve"
> allow="\\machine43name" />     like this.

As Mark said, use the actual name as it appears in the HTTP header, not the Windows corruption of it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


RE: Remote Host Filter

Posted by "Propes, Barry L " <ba...@citi.com>.
Sorry about that....HTML was the default setting -- let me switch it.

I had the following:


<Valve className="org.apache.catalina.valves.RemoteHostValve" allow="\\machine43name" />     like this.



-----Original Message-----
From: Caldarale, Charles R [mailto:Chuck.Caldarale@unisys.com] 
Sent: Monday, May 24, 2010 12:56 PM
To: Tomcat Users List
Subject: RE: Remote Host Filter

> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
> Subject: Remote Host Filter
> 
> allow="\\machine43name<file://\\machine43name>"

Why do you have a leading backwards slash on the allow?

Why do you have a <file:> thingie buried in the allow?  (Hint: send to the list in plain-text only, not HTML.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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


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


Re: Remote Host Filter

Posted by Mark Thomas <ma...@apache.org>.
On 24/05/2010 18:56, Caldarale, Charles R wrote:
>> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
>> Subject: Remote Host Filter
>>
>> allow="\\machine43name<file://\\machine43name>"
> 
> Why do you have a leading backwards slash on the allow?

That looks like Windows name. You need to use the DNS name.

Mark

> 
> Why do you have a <file:> thingie buried in the allow?  (Hint: send to the list in plain-text only, not HTML.)
> 
>  - Chuck
> 
> 
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 




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


RE: Remote Host Filter

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Propes, Barry L [mailto:barry.l.propes@citi.com]
> Subject: Remote Host Filter
> 
> allow="\\machine43name<file://\\machine43name>"

Why do you have a leading backwards slash on the allow?

Why do you have a <file:> thingie buried in the allow?  (Hint: send to the list in plain-text only, not HTML.)

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


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