Invalid command 'VirtualDocumentRoot'
The documentation suggests that the directive is provided by the module vhost_alias. You should ensure that you have the
LoadModule vhost_alias_module modules/mod_vhost_alias.so
configuration directive in the configuration file of the server where it doesn't work.
I had the same error as Andy provided, but in my case, the situation is a bit different. And from the answer of MadHatter, I could devise the problem.
My apache2 server was a bit different. It has 2 directories namely /etc/apache2/mods-available
& /etc/apache2/mods-enabled
. Within directory mods-available
you'll see a list of loadable module config file, in this case, I see a file named vhost_alias.load
which contains the configuration as
LoadModule vhost_alias_module /usr/lib/apache2/modules/mod_vhost_alias.so
So that, I used below command to enable this configuration:
sudo a2enmod vhost_alias