Filed under Blogging
My blog is hosted with an Apache server.
I read this article about how Apache supports access control of files on a server.
There are two parts:
- An .htaccess file that contains all the settings for access control. This file also points to a password file.
- A password file
The .htaccess file impacts everything at the same level as .htaccess and below. The documentation page for .htaccess is here.
A sample .htaccess file looks like this:
AuthName "Password Required"
Require Group admins
I found that I had to start .htaccess with "<Files DIRNAME>" and end with "</Files>" in order to make it work for me...not sure why. I only learned about this after I called my hosting company (1&1) for help. It may be particular 1&1.
Then I had to create a password file (password.file in the above example).
This page explains how to set up a password file with the command "htpasswd."