Apache 2, quickly protect directory with password: Difference between revisions

From Andreida
(Created page with "* Create file with encrypted password htpasswd -c /etc/apache2/.passwd yourname * Create file ".htaccess" in folder to protected (subfolders are protected too) <pre> AuthUse...")
 
No edit summary
Line 9: Line 9:
Require valid-user
Require valid-user
</pre>
</pre>

* add further users without -c
htpasswd /etc/apache2/.passwd othername

Revision as of 22:32, 19 November 2020

  • Create file with encrypted password
htpasswd -c /etc/apache2/.passwd yourname
  • Create file ".htaccess" in folder to protected (subfolders are protected too)
AuthUserFile /etc/apache2/.passwd
AuthType Basic
AuthName "protecting work in progress"
Require valid-user
  • add further users without -c
htpasswd  /etc/apache2/.passwd othername