Changing default Apache page for a virtual host to a mod_autoindex generated listing

apache-2.2directoryindex

I have the following virtual host in my Apache configuration:

<VirtualHost *:80>
    ServerName foobarspaz
    DocumentRoot "/path/to/document/root"
</VirtualHost>

There is no index.html file in the document root directory so accessing http://foobarspaz serves up the default Apache test page for my server.

I'd like it instead to serve up a mod_autoindex generated directory listing of the document root instead of the default page. How would I go about this? (I'm not exactly sure how to go about 'undoing' the default page behaviour for the server root.)

Best Answer

Markus' suggestion didn't work, but after having a look at the /etc/httpd/conf.d/welcome.conf file that Christopher pointed out in his comment I tried the following inside my VirtualHost directive which had the desired outcome:

<LocationMatch "^/+$">
    Options Indexes
</LocationMatch>