Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm unsure as to why I'm getting the following error when apache is rebooted:

Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration Action 'start' failed.

The snippet it is referring to is this:

<VirtualHost *:80>
        VirtualDocumentRoot /local/www/staging/%1

        ServerAlias *

I assumed it was a misspelling as it said, but it was copied directly from another server of mine. It works perfect there. Any ideas?

share|improve this question
up vote 17 down vote accepted

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/

configuration directive in the configuration file of the server where it doesn't work.

share|improve this answer
Thank you very much! That helped me solve it. The code you posted didn't work directly, but I loaded the module using: a2enmod vhost_alias – andy Oct 26 '12 at 10:20
Good for you, for starting from a hint and digging harder - that way lies excellence! – MadHatter Oct 26 '12 at 12:43
Haha. Thanks for your help again :) – andy Oct 26 '12 at 13:55

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/

So that, I used below command to enable this configuration:

sudo a2enmod vhost_alias
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.