Amit Bhawani Blog

Stay Updated!

Powered by Genesis

You are here: Home / How to Guide / How to Build a Password Protected Website?

How to Build a Password Protected Website?

June 14, 2008 by Amit Bhawani

I want to put some stuffs online for only my friends. I don’t want that anybody else gets access to them. I know that this is possible, but as I am completely a non technical person and have very little knowledge about computers I can not provide my website a password protection. Can you please tell me the way of making my website password protected? Oh Sorry I forgot to mention that my website run on Apache Web Server.

Is the Process Simple?
You have more than one option for making your website password protected. Some are simple and some are tough. As you have told that you are not a technical person, the simpler processes will suit you more. So, let us discuss one of the simple methods for making your website password protected.

Elaborate a Simple Process for me.
You have told that your website runs on Apache Web server. This is the most common server for websites. You the use in-built Apache’s file accessing commands for protecting any of your directories. The config file of Apache, i.e. httpd.conf, carries information about all the directories of your website. You can easily alter this file. Restart Apache every time you modify the configuration. Luckily, you can configure the Apache for checking all the directories. Changes made to the directories are employed every time the Apache uses the directory.

Another thing you may need to do is modifying the httpd.conf files, for enabling this directory control. You can enable the .htaccess file through the system administrator or, when you can access the config file yourself, put in the lines given below into the directories, with the .html files.

File Directory Listing

After that you will have to restart the Apache. This will inform the server to perform a complete directory check of public_html along with all the subdirectories for the access-control file. The name provided by default to that file having access-control is .htaccess. This file reads as:

Access Control File

Use the term “valid user” for allowing anybody in .htpasswd file for logging in. If you want more security than this, you will need to have a definite user name for example, “damson link”, which will keep all the others out. M

You will have to ensure that the .htaccess file is world readable and to make it so, type the command below:
Now, finally you will require generating a password file, with the extension .htpassword. You can make use of this program, by typing:
You will get prompts for password. Then add some more names by the following command:

Chmod Htaccess Password

Now edit the .htpasswd file by any text to delete the users. After completing the process when you will try to enter the directory, you will require to type a password before logging in. Thus your website has become password protected.

Share this:

  • Click to share on X (Opens in new window) X
  • Click to share on Facebook (Opens in new window) Facebook

Related

About

My name is Amit Bhawani and here I like to share my internet/tech experience with my online readers. You can follow me on Twitter, Facebook & Instagram at @AmitBhawani I am also the Editor-in-Chief of PhoneRadar & Master Gadgets

About Amit Bhawani

My name is Amit Bhawani and here I like to share my internet/tech experience with my online readers. You can follow me on Twitter, Facebook & Instagram at @AmitBhawani

Comments

  1. Balaji J H says

    October 21, 2008 at 2:37 pm

    Nice stuff
    why we wan’t to go such type of sites
    i think some times there site contains most valuable informations…

  2. Web Host says

    February 5, 2011 at 3:11 pm

    So when you want not to show it to your friends then why you keep it up on a website and pay for hosting ? There are many other free alternative available to that. Isn’t it.

Timeline

Check out Just EV Tweets by @amitbhawani

Recommended To Read

  • How to Find your WiFi Signal Strength & Dead spots in your Home – Best Apps
  • The Wuhan Corona Virus Effect in India – How to Stay Safe
  • This Blogger Lost 25Kgs with this Secret Strategy that Includes a Fitness Tracker
  • Making Money on YouTube, MCN, Useful Tools, Tips & Success Stories
  • The #JaguarPerformance Experience that was Mind Blowing