As I was testing various things to make sure my Apache installation was as secure as possible, I decided check whether I would see a directory list of files. So I created a test directory and added a couple of files:
/var/www/domain/public_html/test
/var/www/domain/public_html/test/a.txt
/var/www/domain/public_html/test/b.txt
To my surprise, when I went to that test directory, I saw a.txt and b.txt listed.
I went back to my setup file and I did have the Options -Indexes setup, so I was wondering why I would see the files a.txt and b.txt
Only my setup looked like this:
<VirtualHost domain:80>
...
Options -Indexes
...
</VirtualHost>
Looking at the documentation for the Options command, it clearly says:
Context: server config, virtual host, directory, .htaccess
Yet, when I put that specific option directly at the VirtualHost level, it does not do anything.
I changed the setup to move the Options in a Directory tag and it works.
<VirtualHost domain:80>
...
<Directory "/var/www/domain/public_html/">
Options -Indexes
</Directory>
...
</VirtualHost>
Is that just a big Gotcha!? Something that one needs to know about to avoid NOT turning off the option one wants to turn off???