Linux Tutorial - Apache Web Login Authentication::
Password protection by a single login: |
Password files:
- Create the directory you want to password protect (example: membersonly)
- Create a file /home/domain/public_html/membersonly/.htaccess in that director that looks something like this:
AuthName "Add your login message here."
AuthType Basic
AuthUserFile /home/domain/public_html/membersonly/.htpasswd
AuthGroupFile /dev/null
require user name-of-user
- Create (or clobber if it already exists) the password file /home/domain/public_html/membersonly/.htpasswd using the program htpasswd:
htpasswd -c .htpasswd name-of-user
No comments:
Post a Comment