1 cd /var/www/html
2 sudo htpasswd -c /etc/httpd/.htpasswd admin
3 nano /etc/httpd/conf/httpd.conf
### below the /var/www/cgi-bin add rule for /var/www/AdminLTE-3.1.0 ####
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<Directory "/var/www/AdminLTE-3.1.0">
AllowOverride All
Options None
Require all granted
</Directory>
4 systemctl restart httpd
5 cd AdminLTE-3.1.0
6 nano .htaccess
## copy this ###
AuthType Basic
AuthName "Password Required"
Require valid-user
AuthUserFile /etc/httpd/.htpasswd
7 systemctl restart httpd
https://www.ionos.com/digitalguide/server/configuration/password-protect-a-directory-with-apache/
No hay comentarios:
Publicar un comentario