User Tools

Site Tools


blog:apache_htaccess_for_ip_or_auth_based_access

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
blog:apache_htaccess_for_ip_or_auth_based_access [2011-08-15 13:49] brbblog:apache_htaccess_for_ip_or_auth_based_access [2022-12-20 14:09] (current) brb
Line 1: Line 1:
 ====== Apache htaccess for ip or auth based access ====== ====== Apache htaccess for ip or auth based access ======
 +
 +Create a password file with a hard to guess name like ''~/.htpass87s9adf'' with usernames and passwords using the commands
 +
 +  htpasswd -B USERNAME PASSWORD PASSWORDFILE
 +  chmod o+r PASSWORDFILE
 +  
 +Create a file ''.htaccess'' using and adapting the following content. In the lines ''Allow from'' you can add IP addresses which will have access without password authentication.
  
 <code> <code>
Line 5: Line 12:
  
 AuthName "Authorisation required" AuthName "Authorisation required"
-AuthUserFile /home/user/.users+AuthUserFile /home/user/PASSWORDFILE
 AuthGroupFile /dev/null AuthGroupFile /dev/null
 AuthType Basic AuthType Basic
blog/apache_htaccess_for_ip_or_auth_based_access.txt · Last modified: 2022-12-20 14:09 by brb