There are essentially two ways to "Apache-protect" your files on the server:
- .Htaccess or .htpasswd protect them
Apache allows .htpasswd protecting using the httpd.conf
The best idea is to store the .htpasswd file in a location not accessible from a browser, ie not the www directory.
Once the htpasswd file is generated, you can specify its location using either method above and restarting your webserver.
If you use the first method, the code you'll want to use is:
If you use the second, the code you'll want to use in your .confd file is:AuthType Basic
AuthName "Name of your secure area”
AuthUserFile /fullpath/to/your/directory/.htpasswd
require valid-user