Skip to main content

You are here

CentOS: Apache - Directory index forbidden by Options directive

By default, the CentOS Apache configuration does not allow index directory listings. So I enabled Indexes Option's for the directory that I wanted allow this feature within my custom vhost . To my surprise after I made the Apache config update, directory listing was not working and I was still getting the default CentOS Apache welcome page.

Apache error log:

[Sat Apr 26 14:42:11 2014] [error] [client] Directory index forbidden by Options directive: /www/mysecureshit/

It turns out the default /etc/httpd/conf.d/welcome.conf file option overrides the +Indexing Options that I explicity enabled within my custom vhost.

# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.

    Options -Indexes
    ErrorDocument 403 /error/noindex.html

The fix was to simply disable welcome.conf.

Premium Drupal Themes by Adaptivethemes