How to Protect Your Site with Password

We have already discussed protection measures for your web as a WAF Firewall or two factor validation. In addition whatever your type of website, you can increase your security by protecting access by password. With this action you have control over who you want to access and to where.

The process to protect your site with password in Apache consists of using .htaccess file. You can have it done in three easy steps, we’ll show you how.

First step to protect your web with password: create the .htaccess file

1. You must create a text file with an editor like the notebook. The content you should paste is:

AuthName “Informational title of the section”

AuthType Basic

AuthUserFile /path/absoluta/hacia/.htpasswd

Require valid-user

2. Save the file with the name .htaccess. Remember that files starting with ‘.’ are hidden files. To see them you must have the option of viewing hidden files on your computer.

Second step to protect your web with password: create .htpasswd file

1. Create a text file with an editor such as the notebook. An example of the content you should paste is:

User:$apr1$wrdCxemm$SwH9oa.pH9IjJcPQb7oms

User is the username. The text after the colon is the encrypted password

2. To create an encrypted password, you can go to http://www.htaccesstools.com/htpasswd-generator/. Enter the username you want to create and the password you have chosen. On the left side you will see the username and the encrypted password.

3. Save the file with the name .htpasswd. Remember that files starting with ‘.’ are hidden files. To see them you must have the option of viewing hidden files on your computer.

Third step to protect your web with password: upload the files to the web

Upload both files to the folder you want to protect from your website server.

Now every time you access to your site, a popup window should appear asking to enter the user name and password to log in.

access-web.

To this measure you can add a continuous security maintenance and complete protection for your web with WeSecur plans.

How to Protect Your Site with Password was last modified: August 24th, 2017 by WeSecur