Trying to use .htaccess and .htpasswd


#1

While I do testing I want to password protect my whole site.

my first question is the ultimate newbie question: “what is my username?” All the instructions for pathnames say “/home/USERNAME” or some such, but the only username I have been given is my ftp and email usernames. Is this the same thing?

Anyway, assuming answer to above is yes…

I have created an .htaccess file that looks like this:

AuthName "This site is currently password protected"
AuthType Basic
AuthUserFile /home/MYSTERIOUSUSERNAMEHERE/.htpasswd
Require valid-user

I put this file at the top of my directory that is named the same name as my domain.

Then, in my root directory (I am using the net2ftp user interface. also at the this level is maildir and logs)
I created an .htpasswd file that looks like this:

site_login_username:password

… but the site won’t let me in. Why?

Also, do I have to put a new .htaccess file in each directory I want to protect, or does the one at the top level apply to all it’s children?

One more: I don’t want to allow directory listings of subdirectories within my domain. How do I do that?

thanks


#2

Sounds like you skipped the password encryption step.

http://wiki.dreamhost.com/index.php/Password-protecting_directories

Did you try using the panel to set it up?

----------
[color=#00CC00]ANONYMOUS0 => Max Discount[/color], [color=#6600CC]ANONYMOUS2 => Max Discount less $1[/color] or Cut the code, [color=#CC0000]it’s their birthday:[/color] [color=#00CC00]9999 => $99.99 Off[/color]


#3

The FTP username given to you when you signed-up is the default machine user created for you by DreamHost. If this is your only user (you can create others), then this will be the username you use for file paths etc.

[quote]I created an .htpasswd file that looks like this:
site_login_username:password[/quote]
Are you using encrypted passwords in your .htpasswd file? You can use the tool linked below to generate your .htpasswd file.

http://webchick.net/tools/htpasswd.php

Add the following line to your .htaccess file.

Options -Indexes

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#4

works like a charm. thanks very much.

Mike