Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|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
add comment

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.

share|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
add comment
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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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