In order to control access by user authentication, you'll need to create a file containing user/password correspondences and tell our server to use that file to authenticate users.
You create the file by using the htpasswd program. To tell our server to use user authentication in a particular directory, you just create a file named .htaccess in the directory that you want to protect and put in the appropriate access control directives.
If you just want to jump in without reading the documentation, you can probably modify the following example to suit your needs. Suppose that I want to create a directory where I can put files to be accessed only by people who have a password that I've given them. Here's what I'd do:
htpasswd -c ~/.my_passwd_file ron htpasswd ~/.my_passwd_file opusIn each case, I'll be prompted to for a password. The first command has a -c. That tells htpasswd that we're starting a new password file. Don't use it on subsequent commands unless you want to wipe your old password file.
Now, when I try to access:
http://www.nmia.com/~tapia/private/I'll be prompted for a password. When playing around with passwords, remember that your client probably remembers passwords so that once you give a valid password, you won't be prompted again until you restart the client.