Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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>
        ServerAdmin help@mydomain.com
        VirtualDocumentRoot /local/www/staging/%1

        ServerAlias *.staging.mydomain.com
</VirtualHost>

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

2 Answers 2

up vote 11 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/mod_vhost_alias.so

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

share|improve this answer
5  
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/mod_vhost_alias.so

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

sudo a2enmod vhost_alias
share|improve this answer

Your Answer

 
discard

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.