You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Janet Dickson <ja...@bioss.sari.ac.uk> on 2005/06/02 13:45:15 UTC

RemoteAddrValve

Hi

I'm trying to use RemoteAddrValve to restrict access to a website to a subnet in 
Tomcat 4.1

Tried :
<Valve className="org.apache.catalina.valves.RemoteAddrValve"
                 allow="xxx.xxx.xxx.xxx/25" />

but it doesnt seem to work as access from one of my IP addresses is forbidden.
Also, I dont seem to be able to put multiple addresses in the allow function ?

Also, can someone confirm whether it is necessary to restart the Tomcat server 
(version 4.1) if I modify an .xml file in the webapps directory ?

Thanks for any help
-- 

	Janet

*************************************************************************
Janet Dickson                        | http://www.bioss.sari.ac.uk/~janet
Biomathematics & Statistics Scotland | email: janet <at> bioss.sari.ac.uk
The King's Buildings, Mayfield Rd    | Telephone: +44 (0) 131 650 4888
Edinburgh EH9 3JZ, Scotland, UK.     | Fax: +44 (0) 131 650 4901
*************************************************************************


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


Re: RemoteAddrValve

Posted by Mark Thomas <ma...@apache.org>.
Janet Dickson wrote:
> Hi
> 
> I'm trying to use RemoteAddrValve to restrict access to a website to a 
> subnet in Tomcat 4.1
> 
> Tried :
> <Valve className="org.apache.catalina.valves.RemoteAddrValve"
>                 allow="xxx.xxx.xxx.xxx/25" />
> 
> but it doesnt seem to work as access from one of my IP addresses is 
> forbidden.
> Also, I dont seem to be able to put multiple addresses in the allow 
> function ?

As per http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html 
this should be a regular expression. Multiple values should be comma 
separated.

> 
> Also, can someone confirm whether it is necessary to restart the Tomcat 
> server (version 4.1) if I modify an .xml file in the webapps directory ?

It depends ;) See 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/host.html#Automatic%20Application%20Deployment


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


Re: RemoteAddrValve

Posted by QM <qm...@brandxdev.net>.
On Thu, Jun 02, 2005 at 12:45:15PM +0100, Janet Dickson wrote:
: I'm trying to use RemoteAddrValve to restrict access to a website to a 
: subnet in Tomcat 4.1

You may want to use a ServletFilter instead.  This is supported by the
2.3 servlet spec, which means it will be portable among containers and
will thus ease your migration to Tomcat 5.x in the future.

Using a Filter would also solve the other problem you mention, that you
find you can't put multiple addresses in the "allow" section.


: <Valve className="org.apache.catalina.valves.RemoteAddrValve"
:                 allow="xxx.xxx.xxx.xxx/25" />
: but it doesnt seem to work as access from one of my IP addresses is 
: forbidden.

If possible, could you share the real IP addresses?  (If they're
internal-only (such as 10.x, 192.168.x, 172.16.x) then you won't expose
any private information posting them here.)  This may be as simple as a
typo.


: Also, can someone confirm whether it is necessary to restart the Tomcat 
: server (version 4.1) if I modify an .xml file in the webapps directory ?

Depends on which XML file.  If it's one of the files that's used by the
container -- context.xml, web.xml, and so on -- then yes, you'll have to
restart.   If it's a file that's loaded by your app on request, then
it's up to your code to decide whether to cache it or reload it every
time.

-QM


-- 

software   -- http://www.brandxdev.net/
tech news  -- http://www.RoarNetworX.com/
code scan  -- http://www.JxRef.org/

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