Issue
Context
I have Apache 2.2.15 configured for mass virtual hosting as follows:
<VirtualHost *:80>
# ...irrelevant lines omitted
VirtualDocumentRoot /srv/www/%-3+
ServerName example.com
ServerAlias localhost
</VirtualHost>
mkdir /srv/www/foo
makes foo.example.com
available.
Problem
HTTP 500 from all of foo.example.com
when a .htaccess
containing only a FallbackResource
directive is in the vhost document root. Commenting out FallbackResource
removes the error, but I want to use FallbackResource
.
Stuff tried
I confirmed the relevant module was loaded using httpd -M | grep dir_module
. Oddly enough I still see Invalid command 'FallbackResource', perhaps misspelled or defined by a module not included in the server configuration
in the error log.
The filesystem is as simple as possible. There is only a "Hello, World" index.php
and a .htaccess
. Yes, permissions are fine.
/srv/www
foo
index.php <- 775, owned by apache
.htaccess <- 664, owned by apache
I tried each of the following in .htaccess
:
FallbackResource index.php
FallbackResource /index.php
FallbackResource foo/index.php
FallbackResource /foo/index.php
Also tried <Directory /srv/www/foo>
even though that would not have worked anyway.
New stuff tried given comments below
AllowOverride Indexes
raisesAllowOverride not allowed here
when entered into<VirtualHost>
container.- Confirmed
LoadModule dir_module modules/mod_dir.so
is inhttpd.conf
Anything stupid/obvious I am missing?
Solution
The FallbackResource directive wasn't introduced until 2.2.16 as described here. Upgrading Apache should solve your problem.
Answered By - BenTheDesigner Answer Checked By - Clifford M. (WPSolving Volunteer)