Empulse Group a collection of notes from a sys admin, musician, and father


Quick Directory Password Protection using Apache

Here are some quick steps to password protect a directory using the Apache web server.

# cd /path/to/www
# vi .htaccess

press 'i' for edit mode
press 'esc' to exit edit mode
':wq' to save

the file should be as follows:

AuthType Basic
AuthUserFile /path/to/www/protect/.htpasswd
AuthName "Restricted Area"
require valid-user

then add the user:

# htpasswd -c /path/to/www/.htpasswd username

then ender a desired password.


UPDATE: You may need to also add the following to the domain Virtual Host block to allow the .htaccess file to be used.

<Directory "/path/to/www/protect">
AllowOverride All

Filed under: Linux Leave a comment
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.

Copyright &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;copy; 2018 Empulse Group &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;middot; Powered by WordPress
Lightword Theme by Andrei Luca Go to top &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;uarr;