Jump to content

access control - how to do multiple rules ?


JoeJoe

Recommended Posts

Hi guys,

After read all the Apache documents, I got no answer for this.
How to config 2 sets of login/password? one is allow from all IP and one is from internal network only.

the order, deny, allow, satisfy stuff only help if one wants
1) login from all IP/domain
or/and
2) request from certain IP/domain [b]WITHOUT[/b] login

that is different from what I want, anyone knows how to solve this?

thank you very much

JoeJoe
Link to comment
Share on other sites

  • 2 weeks later...
JoeJoe,

Check out setEnvIf at http://httpd.apache.org/docs/2.0/mod/mod_setenvif.html

mod_access does not directly support referrer-based and URI based access control, but it can be accomplished using mod_sentenvif and the supported "Allow from env=<server_variable" construct. Here's a simple example:

setenvif Referer www.ok_site.com OK_allow
...
Allow from env=OK_allow

-or-

setenvif Request_URI ip-regex-here OK_allow
...
Allow from env=OK_allow
See mod_setenvif

Good Luck
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.