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

2
  • Is this on centos? Then you may want to remove /etc/httpd/conf.d/welcome.conf Jan 26, 2011 at 5: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. Jan 26, 2011 at 6:19

2 Answers 2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .