10

How do I make a directory listing in apache show the ./hidden files? I tried both

    <Directory /var/www/*>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

and

    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>

but neither show the hidden files

Claudiu
  • 1,157
  • 5
  • 18
  • 27

2 Answers2

18

Somewhere you have an IndexIgnore directive (mods-enabled/autoindex.conf?) that adds dotfiles to the list of files to ignore (mine has .??*) . Once a pattern has been added to the ignore list, it can't be removed.

DerfK
  • 19,313
  • 2
  • 35
  • 51
  • Do you know, if this can be configured "locally", so to solve [this](http://unix.stackexchange.com/questions/55782/make-apache-view-hidden-files-solaris/59217) problem? – Emanuel Berg Dec 26 '12 at 21:16
  • 1
    @EmanuelBerg the directive says it's valid in VirtualHost and .htaccess so it's possible to set it "locally" keeping in mind that you cannot unset filenames added at higher levels, so you'd need to completely remove global configuration. – DerfK Dec 27 '12 at 04:23
  • To be able to list .htaccess .htpasswd files you also have to add explicit listing using the directive; see /etc/apache2/apache2.conf where these files are set to be hidden: ' Order allow,deny Allow from all Satisfy all ' – Daniel Sokolowski Feb 07 '13 at 21:07
9

To amend DerfK's answer: in apache version 2.4 you can, in fact, reset IndexIgnore via a new directive, IndexIgnoreReset

neuro
  • 165
  • 6
Anton Backer
  • 191
  • 1
  • 1