1 2 3 4 |
htpasswd -c /etc/httpd/conf.d/.htpasswd userlogin # Create Password File for Authentication New password: Re-type new password: Adding password for user userlogin |
Результат:
1 2 |
cat/etc/httpd/conf.d/.htpasswd userlogin:$apr0$bq4Tro0n$oYAo1u3KVwmeyV0CWgbIk/ |
Добавляем блок в виртуалхосты *.80, *.443
1 2 3 4 5 6 |
<Directory “/var/www/html”> AuthType Basic AuthName “Authentication Required” AuthUserFile /etc/httpd/conf.d/.htpasswd Require valid-user </Directory> |