How to add Apache level security to a website.

Hope you have apache installed and your application is running on it.

1. Create a .htaccess file in your project folder
           vim .htaccess
2. Add the following lines to the file
          AuthType Basic
          AuthName "By Invitation Only"
          AuthUserFile /Users/home/password_file   #(path to store your u/p)
          Require valid-user       
3. Run the command
          sudo htpasswd -c /Users/home/password_file amal  #(Generates a user - amal & crypted password) 
4. Restart Apache  if needed 

Comments

Popular posts from this blog

How to SSH to remote server without entering password each time.

How to implement Log File Rotation in Linux Servers