How to protect a web folder using HTTP Basic Authentication with Apache2

Run the following to create a password file and enter your password

htpasswd -c /etc/httpd/passwd/myverysecrepasswords admin

-c flag means create a new file

Edit the following accordingly your needs and append into your httpd.conf file

<Directory "/var/www/html/mysecure">
AuthType Basic
AuthName "Protected Files"
AuthBasicProvider file
AuthUserFile /etc/httpd/passwd/myverysecrepasswords
Require user admin
</Directory>

 

Common paths where httpd.confRead the rest

Apache + NGINX

Как это работает

NGINX – разрабатываемый с 2002-го года русскими программистами вэб-сервер. Как правило используется для обработки статического содержимого. В нашем случае мы часто используем спайку “Apache + NGINX”, где последний работает в режиме прокси-сервера. Работа данной связки следуящая:… Read the rest