Directory index forbidden (Apache)
[Sat Aug 03 15:38:51 2013] [error] [client 1.2.3.4] Directory index forbidden by Options directive: /var/www/html/example.com/www/
Apache version:
[root@talyn html]# /usr/sbin/httpd -v
Server version: Apache/2.2.3
Server built: Jun 26 2013 10:33:42
Permissions appear to be correct:
[root@talyn html]# ll /var/www/html/example.com/
drwxr-x–- 2 me apache 4096 Aug 3 14:02 www
Modules are loaded:
LoadModule autoindexmodule modules/modautoindex.so
LoadModule dirmodule modules/moddir.so
LoadModule aliasmodule modules/modalias.so
Here is the relevant portion of my httpd.conf:
ServerName rpm.example.com
Options +Includes +Indexes
IndexOptions FancyIndexing VersionSort NameWidth=* HTMLTable
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t
Alias /icons/ "/var/www/icons/"
-Indexes should not be overriding this anywhere. I know it is in welcome.conf, but I have commented out the entire contents.
If I place an index.html file in the web root it displays it, but not the directory. My understanding is that I should not need to have one in there, as mod_autoindex should generate the listing.
There are no .htaccess files in play. I don't use them at all.
What am I missing?
3 Replies
Since the last trio of permissions is "everybody", and your web visitors fall into the "everybody" group, you'll want them to be able to access the files in that directory.
You did reload Apache after making changes to the configuration, right? Maybe look at the error log to see if it complains about your configuration at startup.
The error specifically complains about the Options directive, so check through all the included config files to see if -Indexes appears anywhere.
The below are longer shots given the error message, but other possible things to look at.
The permissions look fine (accesses to the filesystem will be as the user/group Apache is running as). Double-check that the user/group "apache" is the correct one - for example, in Debian and Ubuntu, the user and group are named "www-data" instead. If necessary, change group ownership of the /var/www/html/example.com/www/ directory.
Perhaps one of the settings is causing trouble? Try commenting out the IndexOptions and IndexIgnore directives, reload Apache, and see if you at least get a basic index display.