All pastes #41815 Raw Edit

megaspaz

public text v1 · immutable
#41815 ·published 2006-02-16 06:45 UTC
rendered paste body
go into the directory you want to access protect. run the command:
touch .htaccess

then edit that file so it looks like:

AuthUserFile /full/path/to/directory_to_be_protected/.htpasswd
AuthName "Authorization Required"
AuthType Basic
require valid-user

that's what should be in the .htaccess file.

then use this command for setting up the password for the first user.

(22:17:03) megaspaz: then run this command in the same directory:

/path_to_apache_install/bin/htpasswd -c ./.htpasswd <username>"

then you need to edit your httpd.conf file and add.

<Directory "/full/path/to/directory_to_be_protected">
  AllowOverride AuthConfig
  Options Indexes SymLinksIfOwnerMatch Includes
  Order allow,deny
  Allow from all
</Directory>