Enable password on Apache by htpasswd

1. Add the following lines to .htaccess

AuthName “NAME”
AuthType Basic
AuthUserFile “/path/.htpasswd”
require valid-user

2. Create htpasswd by this command:

htpasswd -c /path/.htpasswd USERNAME