Un po’ di direttive per proteggere cartelle con l’AuthType Basic di apache

febbraio 17, 2009
By

Copio e incollo da questa ottima guida

Per un file solo:

<Files login.php>
Order deny,allow
Deny from all
AuthName "htaccess password prompt"
AuthType Basic
AuthUserFile /home/askapache.com/.htpasswd
Require valid-user
</Files>

Per Più files

<FilesMatch "^(exec|env|doit|phpinfo|w).*$">
Order deny,allow
Deny from all
AuthName "htaccess password prompt"
AuthUserFile /.htpasswd
AuthType basic
Require valid-user
</FilesMatch>

network/netmask pair

Order deny,allow
Deny from all
Allow from 10.1.0.0/255.255.0.0

Per IP

Order deny,allow
Deny from all
Allow from 10.1.2.3

Per più IP

Order deny,allow
Deny from all
Allow from 192.168.1.104 192.168.1.205

Per Varie Subnet

Order deny,allow
Deny from all
Allow from 10.1
Allow from 10 172.20 192.168.2

Per Range di IP

Order deny,allow
Deny from all
Allow from 10.1.0.0/16

Indirizzi e subnet IPv6

Order deny,allow
Deny from all
Allow from 2001:db8::a00:20ff:fea7:ccea
Allow from 2001:db8::a00:20ff:fea7:ccea/10

Deny subdomains

Order Allow,Deny
Allow from apache.org
Deny from wireshark.apache.org

Da un IP senza password e da dovunqe altro con password

Order deny,allow
Deny from all
AuthName "htaccess password prompt"
AuthUserFile /home/askapache.com/.htpasswd
AuthType Basic
Require valid-user
Allow from 172.17.10.1
Satisfy Any

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *


*