geerlingguy/ansible-role-apache

Apache is ignoring DirectoryIndex set via apache_global_vhost_settings in vhosts.conf

websafe opened this issue · 4 comments

Hello,

I've noticed that on Debian 11 Apache is ignoring the first line in vhosts.conf:

DirectoryIndex index.php index.html

and

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm

from /etc/apache2/mods-enabled/dir.conf takes precedence.

So when a directory contains index.html and index.php the index.html is being served every time, despite having DirectoryIndex index.php index.html in vhosts.conf.

When I move the DirectoryIndex index.php index.html in vhosts.conf into <VirtualHost *:80>...</VirtualHost> or <VirtualHost *:443>...</VirtualHost> everything behaves as expected.

Or maybe I'm doing something wrong?

stale commented

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

According to the official documentation this is expected behaviour:

Multiple DirectoryIndex directives within the same context will add to the list of resources to look for rather than replace

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.