| Author |
Getting problem while applying IP restriction
|
Usman Saeed
Ranch Hand
Joined: May 21, 2008
Posts: 30
|
|
My web application name is 'ucp' and i want to apply IP restriction on 'Admin' folder in it.
i wrote following code in ..\tomcat6\conf\Catalina\localhost\ucp.xml
but whole application has been forbidden for mentioned IP address instead of only 'Admin' folder.
Need help!
|
Usman Saeed
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
"Admin" isn't a folder, it's a webapp, and depending on how things are deployed, it may not even be the actual URL root for the deployed webapp.
You may find that placing the webapp in its own virtual Host helps.
|
Customer surveys are for companies who didn't pay proper attention to begin with.
|
 |
Usman Saeed
Ranch Hand
Joined: May 21, 2008
Posts: 30
|
|
Thank you for your reply Tim,
Actually i have two portions of my webapp;
1. for students having URL online.ucp.edu.pk/Student/index.htm
2. for administrators having URL online.ucp.edu.pk/Admin/index.htm
What i want is to allow/restrict administrator portion from some specific IPs or rage of IPs.
xml code i mentioned is restricting whole application, but i need to restrict only administrator portion not students portion.
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 14456
|
|
Since you say that's one app, I presume you've installed it as the root app, which means your Context definition is all wrong. Context is for an entire webapp, not part of a webapp.
Normally I do that kind of access control by setting up rules in the J2EE security system, not by IP filtering. That way administrators can work from home, if they need to and students can't get access to admin functions just because they're on-campus..
|
 |
leo donahue
Ranch Hand
Joined: Apr 17, 2003
Posts: 327
|
|
If your web application name is ucp, you can't have a path attribute in context pointing to /Admin. In fact, you shouldn't have the path attribute set at all.
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
|
Thanks, leo
|
 |
 |
|
|
subject: Getting problem while applying IP restriction
|
|
|