Tuesday, April 19, 2022

[SOLVED] Apache won't autoindex

Issue

  • Oracle Linux 7.3 (RHEL derivative)
  • Apache 2.4.6

I'm setting up a repository in /srv/www for yum, scripts, and kickstart files, served via httpd. I want an auto-index, so I don't have any index.html. And, this is the only thing this internal server will do. So, httpd.conf:

DocumentRoot "/srv/www"

<Directory "/srv/www">
  AllowOverride all
  Options Indexes FollowSymLinks
  Require all granted
</Directory>

However, I still get the error message:

[autoindex:error] [pid 12345] [client <IP address>:<port>] AH01276: Cannot serve directory /srv/www: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive.

Except that the Options directive allows auto-indexing! I've tried Options All. I've tried Options +Indexes +FollowSymLinks. I've looked at 7 or 8 Google hits. Nothing is working.

Setting LogLevel debug doesn't increase messaging.

What have I missed?


Solution

As noted here, in the absence of an index.html (or other configured index file), the welcome page configured at /etc/httpd/conf.d/welcome.conf will take precedence over other configurations via its LocationMatch directive. Rename the file so it doesn't end in .conf and auto-indexing works.



Answered By - dafydd
Answer Checked By - Clifford M. (WPSolving Volunteer)