HowTo use .htaccess file for Apache authentication

1. Create the directory you want to password protect (example: nikesh)

2. Create a file /var/www/html/nikesh/.htaccess in that director that
looks something like this:

AuthName “Add your login message here.”
AuthType Basic
AuthUserFile /etc/apache/.htpasswd
AuthGroupFile /dev/null
require user name-of-user

In this case the “name-of-user” is the login name you wish to use for
accessing the web site.

3. In apache configuration file, change the AllowOverride to
AuthConfig for the directory that you wan to protect with password.


AllowOverride AuthConfig

3. Create the password file /etc/apache/.htpasswd using the program
htpasswd:

# htpasswd -c .htpasswd name-of-user

Read Man page: htpasswd




ref:linuxlight.blogspot.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Linux Users Group.
To post a message, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit our group at 
http://groups.google.com/group/linuxusersgroup
-~----------~----~----~----~------~----~------~--~---

Reply via email to