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

I have the following vhost configured:

<VirtualHost *:80>
    DocumentRoot /var/www/myvhost
    ServerName myv.host.com
    ServerAlias myv.host.com
    ErrorLog logs/myvhost-error_log
    CustomLog logs/myvhost-access_log combined
    ServerAdmin myv@host.com
    <Directory /var/www/myvhost>
        AllowOverride All
        Options +Indexes
    </Directory>
</VirtualHost>

The configuration appears to be correct from the apachectl tool's perspective.

However, I cannot get a directory listing on that vhost:

Forbidden

You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

The error log shows the following:

[Wed Mar 07 19:23:33 2012] [error] [client 66.6.145.214] Directory index forbidden by Options directive: /var/www/******

update2

More recently, the following is now kicking-into the error.log:

[Wed Mar 07 20:16:10 2012] [error] [client 192.152.243.233] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/error/noindex.html

update3

Today, the following is getting kicked-out:

[Thu Mar 08 14:05:56 2012] [error] [client 66.6.145.214] Directory index forbidden by Options directive: /var/www/<mydir>
[Thu Mar 08 14:05:56 2012] [error] [client 66.6.145.214] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/error/noindex.html
[Thu Mar 08 14:05:57 2012] [error] [client 66.6.145.214] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

This is after modifying the vhosts.conf file thusly:

<VirtualHost *:80>
    DocumentRoot /var/www/<mydir>
    ServerName myhost
    ServerAlias myhost
    ErrorLog logs/myhost-error_log
    CustomLog logs/myhost-access_log combined
    ServerAdmin admin@myhost
    <Directory "/var/www/<mydir>">
         Options All +Indexes +FollowSymLinks
         AllowOverride All
         Order allow,deny
         Allow from all
    </Directory>
</VirtualHost>

What is missing?

update 4

All subdirectories of the root directory do directory listings properly - it is only the root which cannot.

share|improve this question
5  
Anything interesting in your error log ? What does your browser display ? –  Iain Mar 7 '12 at 19:44
    
@Chris S - no mod_index listed in the httpd.conf - nor is there a mod_index on the filesystem –  warren Mar 7 '12 at 19:49
    
is there a local .htaccess file that might be setting -Indexes ? –  voretaq7 Mar 7 '12 at 19:50
    
@voretaq7 - no .htaccess in this vhost –  warren Mar 7 '12 at 19:50
    
@warren Sorry, that should have been mod_autoindex, it's the module that creates directory listing pages. –  Chris S Mar 7 '12 at 19:52

3 Answers 3

A 403 means the resource is being found. Check that apache has at some level permission to r-x the document root and all the directories above it and r-- the files therein.

Try changing you Directory directive to

<Directory /var/www/myvhost>
    AllowOverride All
    Options +Indexes
    Order allow,deny 
    Allow from all
</Directory>
share|improve this answer
    
775 on the parent dir, and at least 644 on all contents –  warren Mar 7 '12 at 19:58
    
check it has suitable r-x perms on /var and /var/www too. –  Iain Mar 7 '12 at 20:01
    
all other vhosts on this server render properly - which makes this really annoying. Also, even with an 'index.htm' file added, still getting a 403 error –  warren Mar 7 '12 at 20:15
    
If the filesystem paths are ok then something else is blocking it try adding Order allow,deny Allow from all to your vhosts <Directory /var/www/myvhost> definition –  Iain Mar 7 '12 at 20:23
    
added - and still no dice ... fs perms look completely normal: vhost config looks like all others (except for the directory listing bit). –  warren Mar 7 '12 at 20:28

I had a similar problem today where I was seeing an error like yours shown above:

[Wed Oct 17 14:19:08 2012] [error] [client 123.66.66.22] Options FollowSymLinks or SymLinksIfOwnerMatch is off which implies that RewriteRule directive is forbidden: /var/www/mysite/

Mixing options with and without +/- is problematic, note the apache docs on options:

Mixing Options with a + or - with those without is not valid syntax, and will be rejected during server startup by the syntax check with an abort.

Also the effect of validly using a directive without a +/- removes all other previously set directives for that directory.

I had used an Indexes without the + and had the error I copied above.

Since you say you are not using any .htaccess files, why not change the Directory directive to this:

<Directory /var/www/myvhost>
    AllowOverride None
    Options +Indexes
    Order allow,deny
    Allow from all
</Directory>
share|improve this answer
up vote 0 down vote accepted

My solution (as of 21 Mar 2012)

  • move all content to a subdirectory
  • create a redirect index.html file in the root that reloads to the subdirectory

I still want to know why I cannot just traverse the directory itself, but this is working for now.

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.