You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Erik Weber <er...@mindspring.com> on 2004/09/17 23:35:13 UTC

[OT] Apache/Tomcat restriction by IP address

I have a site running on a third-party box that uses Apache in front of 
Tomcat. I need to restrict the entire site to a series of IP addresses.

Using the Deny, Order and Allow commands in a .htaccess file works for 
whatever is in Apache's public document root. However, it doesn't 
prevent requests that are dispatched to Tomcat.

For example, if I forbid my own IP address with this:

Deny from xxx.xx.xx.xxx

I cannot access anything in Apache's document root, but I can still 
access any pages that are served by Tomcat. (Apache is configured to 
dispatch *.jsp to Tomcat).

How can I tell Apache to filter *all* requests by IP address?

Thanks,
Erik

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Apache/Tomcat restriction by IP address

Posted by Erik Weber <er...@mindspring.com>.
Thanks Niall.

The problem is, some stuff is served out of Apache's doc root, while 
other stuff is served by Tomcat. I am hoping to find a central place to 
install the IP restriction.

The valve won't restrict what is in Apache's doc root, and the .htaccess 
file won't restrict what is dispatched to Tomcat (I think .htaccess is 
at the file/directory level, and I need it at the URL level). However, 
.htaccess combined with valves seemingly would do the trick. I haven't 
tried it yet.

If anyone knows how to configure it all in Apache though, I would 
appreciate a tip. I think it might be done in httpd.conf, but I'm still 
trying to figure it out. Plus I have the problem of figuring out the 
nuances of the third-party hosting environment (for example, there *is* 
no httpd.conf :/).

Thanks,
Erik


Niall Pemberton wrote:

>Don't know about Apache, but what about configuring Tomcat - doc say there
>are remote filters which looks like they would do what you want:
>
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html
>
>Niall
>
>
>----- Original Message ----- 
>From: "Erik Weber" <er...@mindspring.com>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Friday, September 17, 2004 10:35 PM
>Subject: [OT] Apache/Tomcat restriction by IP address
>
>
>  
>
>>I have a site running on a third-party box that uses Apache in front of
>>Tomcat. I need to restrict the entire site to a series of IP addresses.
>>
>>Using the Deny, Order and Allow commands in a .htaccess file works for
>>whatever is in Apache's public document root. However, it doesn't
>>prevent requests that are dispatched to Tomcat.
>>
>>For example, if I forbid my own IP address with this:
>>
>>Deny from xxx.xx.xx.xxx
>>
>>I cannot access anything in Apache's document root, but I can still
>>access any pages that are served by Tomcat. (Apache is configured to
>>dispatch *.jsp to Tomcat).
>>
>>How can I tell Apache to filter *all* requests by IP address?
>>
>>Thanks,
>>Erik
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Apache/Tomcat restriction by IP address

Posted by Erik Weber <er...@mindspring.com>.
I just finished setting up a Valve for (Tomcat) IP restriction and it 
worked fine.

Since I am in a rare good mood, I decided that it was time for me to 
give some positive feedback where it is due, since I mostly just complain.

The Tomcat documentation, and the Struts documentation, though not 
perfect, are both quite comprehensive. It is obvious that a lot of 
thought and work have gone into it all, and I appreciate it.

In addition, I will say that this (user@struts.apache.org) is the best 
user list I have ever found. I actually would have been prepared to say 
that within the first couple of weeks after discovering it.

When you see the people who write and/or contribute to the source code 
continuing to post to the user list on a daily basis, you know you are 
in with a good group.

Keep up the good work.

Erik




Niall Pemberton wrote:

>Don't know about Apache, but what about configuring Tomcat - doc say there
>are remote filters which looks like they would do what you want:
>
>http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html
>
>Niall
>
>
>----- Original Message ----- 
>From: "Erik Weber" <er...@mindspring.com>
>To: "Struts Users Mailing List" <us...@struts.apache.org>
>Sent: Friday, September 17, 2004 10:35 PM
>Subject: [OT] Apache/Tomcat restriction by IP address
>
>
>  
>
>>I have a site running on a third-party box that uses Apache in front of
>>Tomcat. I need to restrict the entire site to a series of IP addresses.
>>
>>Using the Deny, Order and Allow commands in a .htaccess file works for
>>whatever is in Apache's public document root. However, it doesn't
>>prevent requests that are dispatched to Tomcat.
>>
>>For example, if I forbid my own IP address with this:
>>
>>Deny from xxx.xx.xx.xxx
>>
>>I cannot access anything in Apache's document root, but I can still
>>access any pages that are served by Tomcat. (Apache is configured to
>>dispatch *.jsp to Tomcat).
>>
>>How can I tell Apache to filter *all* requests by IP address?
>>
>>Thanks,
>>Erik
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>>    
>>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] Apache/Tomcat restriction by IP address

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Don't know about Apache, but what about configuring Tomcat - doc say there
are remote filters which looks like they would do what you want:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html

Niall


----- Original Message ----- 
From: "Erik Weber" <er...@mindspring.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Friday, September 17, 2004 10:35 PM
Subject: [OT] Apache/Tomcat restriction by IP address


> I have a site running on a third-party box that uses Apache in front of
> Tomcat. I need to restrict the entire site to a series of IP addresses.
>
> Using the Deny, Order and Allow commands in a .htaccess file works for
> whatever is in Apache's public document root. However, it doesn't
> prevent requests that are dispatched to Tomcat.
>
> For example, if I forbid my own IP address with this:
>
> Deny from xxx.xx.xx.xxx
>
> I cannot access anything in Apache's document root, but I can still
> access any pages that are served by Tomcat. (Apache is configured to
> dispatch *.jsp to Tomcat).
>
> How can I tell Apache to filter *all* requests by IP address?
>
> Thanks,
> Erik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org