httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <rob...@profundis.nu>
Subject Re: [users@httpd] Q:Access control based on ip and/or user
Date Mon, 14 Jun 2004 14:34:13 GMT
Rainer Krienke wrote:
> So if a user accesses the web pages from an address say 192.1698.1.1
> access should be granted without user authentification.  If the user tries
to
> access the web page from any other host he should have to authenticate
> himself in the usual manner (AuthType Basic, require valid-user).

Fairly simple. In your .htaccess file:

    # Authenticate using basic auth
    AuthType Basic
    AuthName "Super Secret!"
    AuthUserFile /path/to/passwords
    Require valid-user

    # Authorize using mod_access
    Order Deny,Allow
    Deny from all
    Allow from 192.168.1.1

    # Tell Apache any method will do
    Satisfy any

See:
    http://httpd.apache.org/docs-2.0/mod/mod_access.html
    http://httpd.apache.org/docs-2.0/mod/core.html#satisfy

Regards,
Robert Andersson


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message