A Short Guideline to Create Password Protected Web Directory Using .htpasswd

October 24, 2007 § 2 Comments

Because of some consecutive requests on “how to create password protected web directory”, I am putting a short guideline so I can refer them to this page in future:

  1. Make an htaccess file (in your desired directory) like this:

———-.htaccess—————————————

AuthUserFile /your/path/passwordprotected/path/.htpasswd

AuthName “Display Text”

AuthType Basic

Require valid-user

————————————————————–

  1. Make the .htpasswd file in the specified directory.

3. Add username and password (to enter this web directory)

You can add and update user and password by using:

>htpasswd –bm /your/path/passwordprotected/path/.htpasswd username password

b: Batch mode which facilitates you to enter user and password in the command prompt.

m: Use MD5 encryption for passwords. You can use “d” for crypt() generated passwords, “s” for SHA1 passwords, “p” for plain text passwords.

Once these steps are done, the .htpasswd looks like:

——————–.htpasswd————————————-

phpResource:$apr1$roLEO/..$ZXhi6TbX6L22wG78yhWtR/

rupom:$apr1$dcIUu…$8zByhyvWMi9oKHBReQv/n0

——————————————————————–

[I have created user “rupom” with password “rupom” and user “phpResource” with password “phpResource”].

Now, go to the URL where this is done, you will find what you expected.

Done! Enjoy !!

See http://httpd.apache.org/docs/1.3/programs/htpasswd.html for manual of htpasswd.

 

BEST REGARDS.

Advertisements

Tagged: , ,

§ 2 Responses to A Short Guideline to Create Password Protected Web Directory Using .htpasswd

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

What’s this?

You are currently reading A Short Guideline to Create Password Protected Web Directory Using .htpasswd at Rupom Here.

meta

%d bloggers like this: