4

I have the following block in my .conf file but when I load the appropriate URL (which points to a directory with just a dummy .txt file in it) I get the Apache 2 Test Page instead of a directory listing.

<Directory "/var/www/sites/www.some-site.com/public">
  Options Indexes
  [...other settings that are working fine...]
</Directory>

If I put an index.html file in there, it loads as expected.

The "other settings" I've omitted are for LDAP HTTP authentication and such, and they are also all working as expected.

There's no .htaccess file in the directory.

I just can't seem to get directory browsing working.

I've also tried +Indexes as well, still no luck.

3 Answers3

16

boss found the issue. it was the conf.d/welcome.conf file. it had a LocationMatch directive that detected the absence of an index.html file and defaulted to the welcome page.

2

Basic steps:

  • Check and make sure there isn't an.htaccess file over-riding your settings (set AllowOverride None which might help)
  • Check and make sure your directory can be read by Apache
  • Check and make sure you don't have another <directory> flag that is over-riding your settings.
Satanicpuppy
  • 5,994
0

I had a similar problem in a virtual host on my Apache server: I wanted to disable directory listing so I edited the .conf file adding a -Indexes option but it seemed not working. No .htaccess were enabled and no other directives was overriding my rule.

After some headache I discovered the silliest cause: I had two .conf files, one for http access, the other one for SSL. I was of course accessing the site using the protocol related to the still unedited .conf file

Hope this will save some times to another distracted user like me :)