Reply to comment

.htaccess

This is a cheap and effective way to password protect a directory:

1. Edit/create the .htaccess file and add the following lines:

AuthUserFile /home/someuser/etc/apache/.htpasswd
AuthName "Restricted Reports"
AuthType Basic

require valid-user

2. Use htpasswd command to make your .htpasswd file. Technically you could call it fluffy-monkey but that's not a very helpful name.

example.com:[]% htpasswd -h
Usage: htpasswd [-c] passwordfile username

The -c flag creates a new file.

example.com:[]% htpasswd -c .htpasswd someuser
Adding password for someuser.
New password:
Re-type new password:
example.com:[]%

For security its best keep your password file outside of docroot.

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.