According to the Apache documentation, found here, the DirectoryIndex
directive needs to be specified in the site .conf
file (typically found in /etc/apache2/sites-available
on linux).
Quoting from the docs, it reads:
If no file from the DirectoryIndex
directive can be located in the
directory, then mod_autoindex can generate a listing of the directory
contents. This is turned on and off using the Options
directive. For
example, to turn on directory listings for a particular directory, you
can use:
Options +Indexes
To prevent directory listings (for security purposes, for example),
you should remove the Indexes keyword from every Options directive in
your configuration file. Or to prevent them only for a single
directory, you can use:
Options -Indexes