Allowing directory view/traversal for a specific VirtualHost in Apache 2.2

Posted by warren on Server Fault See other posts from Server Fault or by warren
Published on 2012-03-07T19:31:07Z Indexed on 2012/10/17 23:04 UTC
Read the original article Hit count: 214

Filed under:
|
|

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 [email protected]
    <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.

© Server Fault or respective owner

Related posts about apache2

Related posts about virtualhost