Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

I'd use

<Location /my>
    AuthType Basic
    AuthName "private area"
    AuthUserFile /etc/apache2/mypass
    Require valid-user
  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
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
up vote 1 down vote accepted

What I needed was:

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

I put pw file seperated from content.

ssl coming asap

share|improve this answer

Your Answer


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.