How to create password protecting directories?

1) Create a .htaccess file and specify the following code in it,

 

AuthType Basic

AuthName “Administration”

AuthUserFile /home/support/.htpasswd

require valid-user

 

2) To create a passwd file, use the following .htpasswd generator.It should allow you to generate a

 

username /  encrypted password pair.

 

http://www.desilva.biz/apache/pwdweb.html

 

The .htpasswd file will contain your username(s) and encrypted password(s) and will usually look like this:

 

Christopher:En7Cr9pT2Ed/u

Mak3m0n3y

 

Place the .htaccess file in the directory that is to be protected.

 

And place the .htpasswd outside the directory that is to be protected.

 

Example:

If you want to protect a directory “blog” under a particular domain

then the .htaccess file should be placed in the “blog” directory and the .htpasswd

the file should be placed in the “html ” directory.

 

Note that all the directories that are created under the blog directory will also get protected.

 

 

 

And execute the command grpconv to rebuild the file.

 

You can now create the new account, without any error message.