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 Answers 3

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.

1
  • 3
    Upvote for reporting the fix.
    – pboin
    Oct 1, 2009 at 17:51
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.
2
  • - no .htaccess file - directory is being read by apache - how would another directory flag override my settings? thanks.
    – Teflon Ted
    Oct 1, 2009 at 16:55
  • It can happen, though honestly I thought it unlikely in this case because your directory was so deep. One of the cool things about the directory directive is that you can next them over and over, so you can assign general stuff at / and then more specific stuff all the way down. Glad you found the issue. I'd never even used that directive before...Of course, I am a terrible .htaccess person, which is about the worst apache flaw you can have. Talk about unexpected behaviour. Oct 1, 2009 at 19:14
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 :)

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .