February 16, 2005

Apache simple auth

Example:
Add auth in directory /home/pank/public_html/auth
User pank, password 1111

  1. Create .htaccess (in /home/pank/public_html/auth)
    AuthName "Simple Auth"
    AuthType Basic
    AuthUserFile "/home/pank/public_html/auth/.htpasswd"
    require valid-user
  2. Create .htpasswd
    htpasswd -cb .htpasswd pank 1111
    (-c for Create a new file, -b for Use the password from the command line rather than prompting for it)
    htpasswd -b .htpasswd test 2222
  3. Edit httpd.conf
    <Directory "/home/pank/public_html/auth">
      AllowOverride All
    </Directory>
  4. Restart Apache

    Posted by pank at February 16, 2005 11:20 AM
Comments
Post a comment













Remember personal info?