I created a vhost in apache with this config

Alias   /my    /srv/my

<Location /my>
    AuthType basic
    AuthName "private area"
    AuthBasicProvider file
    AuthUserFile /var/www/vhosts/my/mypass
    Require valid-user
</Location>

I enter the url in browser, am asked for passwd but get access denied. All further request are denied without asking (cached?).

Prob is it wont accept my passwd, even I updated the passwd file so i am sure to use the correct one.

link|improve this question

Did you generate mypass using htpasswd? Have you tried to use a rather simple password to exclude encoding issues? – mbx Apr 4 '11 at 13:42
feedback

2 Answers

I'd use

<Location /my>
    AuthType Basic
    AuthName "private area"
    AuthUserFile /etc/apache2/mypass
    Require valid-user
    SSLRequireSSL
</Location>
  1. Keep your password file separated from the content.
  2. Use encryption.

Did you saved passwords in plain text in mypass? If so, use htpasswd.

link|improve this answer
1  
This should do it. One thing to add; check for any errors in Apache's log related to the htpasswd file, such as a permissions issue. – Shane Madden Apr 4 '11 at 14:43
feedback
up vote 1 down vote accepted

What I needed was:

<Directory "/srv/my">
    Options Indexes
    Order allow,deny
    allow from all
</Directory>

I put pw file seperated from content.

ssl coming asap

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.