ansible-role-apache icon indicating copy to clipboard operation
ansible-role-apache copied to clipboard

Apache is ignoring DirectoryIndex set via apache_global_vhost_settings in vhosts.conf

Open websafe opened this issue 2 years ago • 3 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?

websafe avatar Feb 22 '23 12:02 websafe

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.

stale[bot] avatar Jun 18 '23 04:06 stale[bot]

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

JonasPammer avatar Aug 20 '23 09:08 JonasPammer

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.

github-actions[bot] avatar Dec 25 '23 18:12 github-actions[bot]

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.

github-actions[bot] avatar Feb 26 '24 18:02 github-actions[bot]