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 have a virtual host with a configuration like that.

When i'm trying to get into foobar.com/dir providing valid username/password pair i get 403 forbidden page instead of that directory contents.

www.foobar.com/dir has 777 rights, .httpaswd is chmoded 644. But i can't figure out why i am still not seeing contents. Please, give me a hint.

ServerAdmin webmaster@localhost 
ServerName www.foobar.com
ServerAlias www.foobar.com

DocumentRoot /var/www/foobar
<Directory />
    Options FollowSymLinks
    AllowOverride All       
</Directory>
<Directory /var/www/foobar>
    Options -Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>
<Directory /var/www/foobar/dir>
        AllowOverride AuthConfig
        AuthName "Authorize yourself, please!"
        AuthType Basic
        AuthUserFile /etc/apache2/.htpasswd
        AuthGroupFile /dev/null
        Allow from All
        Order Allow,Deny
            Options +Indexes<<- that one should be added                              
        Require valid-user

share|improve this question
    
What apache says in access/error logs? –  Khaled Jun 24 '12 at 9:09
    
Shouldn't you have Options +Indexes in there somewhere? –  SmallClanger Jun 24 '12 at 9:20
    
Error log says" [Sun Jun 24 01:12:45 2012] [error] [client <ipadress>] Directory index forbidden by Options directive: /var/www/foobar/dir/ –  alexeygaidamaka Jun 24 '12 at 9:23
    
The problem was in Indexes! Thank you, guys! –  alexeygaidamaka Jun 24 '12 at 9:26
1  
Please post the solution as an answer. –  Iain Jun 24 '12 at 9:30

1 Answer 1

Add Options +Indexes in the last <Directory> statement

share|improve this answer

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.