0

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.)

Jenny D
  • 27,358
  • 21
  • 74
  • 110
Simon Lieschke
  • 187
  • 3
  • 9
  • Is this on centos? Then you may want to remove /etc/httpd/conf.d/welcome.conf – becomingwisest Jan 26 '11 at 05:11
  • Yeah, after having a look in that file that indeed would do the trick. I'm looking to solve it next to my existing configuration as it's one less step to do if the server ever needs to be rebuilt. – Simon Lieschke Jan 26 '11 at 06:19

2 Answers2

2

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>
Simon Lieschke
  • 187
  • 3
  • 9
0

Maybe something like this might work:

<Directory /path/to/document/root>
   Options Indexes
</Directory>

And yes, as the other poster pointed out, remove the welcome.conf (in Ubuntu) or similar default config.