DreamHost Password Protect Dir
There are many situations where you want to protect your html pages using password. In apache web server, you can do this by using .htaccess file and htpasswd command. Once you have set AuthName & AuthType parameters in .htaccess file and create a password file using htpasswd command, your html pages will be protected.
It is hard to implement password protected directory using .htaccess file and htpasswd command. DreamHost provide a very simple way to do this work.
Let’s have a look at practical example of password protected directory in DreamHost. Let’s say, I have few private files which I don’t want to make public. What will I do to make it password protected?
DreamHost Password Protected Directory Example
I have created directory called ‘private’ to make it password protected. I have put that directory in the root directory of this domain. So if somebody access http://ahappycustomer.dreamhosters.com/private/, username and password should be asked.
Here are simple steps to achieve this setting.
First go to DreamHost Panel and open Htaccess/WebDAV page. You can find that page under Goodies section.

Now select the domain in which you want to make password protected directory. For our example, I will use this domain. So I will select http://www.ahappycustomer.dreamhosters.com/ .

Now click on “Set Up A New Directory” button. It will take you to the next page and ask you more information about the directory for which you want to setup a password. You will also set the username and password on the same page.

As seen in the above image, I’ll give directory name ‘private’. Check the “Password-protect this dir?” checkbox. Now you need to enter the directory name. It’s just a kind of description of what data is being protected. You can enter any description you like. I have just entered “Private Section”.
Next you need to enter username and password in particular ‘username password’ format. I want to setup username as ‘happy’ and password as ‘customer’. So I have entered ‘happy customer’. You can enter as many usernames and passwords as you like. Just make sure that you follow the ‘username password’ syntax and enter them into one per line.
All other things you can ignore. Click on “Configure This Directory” button.
Now your directory will become password protected and DreamHost will send you an email after setup is completed.
Just to make sure that everything is working fine, you can go to directory URL and it should ask you username and password.
For my set up, http://ahappycustomer.dreamhosters.com/private/ is now password protected. You can access that page by entering username as ‘happy’ and password as ‘customer’.
I hope you like the article. If you have any doubt you can contact me.
Go To DreamHost How To.
Go To Home.
