Michael Hofmair
Michael Hofmair

Reputation: 135

Invalid command 'VirtualDocumentRoot'

I tried to configure my virtual PHP Devserver to use a part of the domain to serve different Directory's depending on the domain the request comes from... I guess that apache's missing the Virtual alias Module. I just can't figure out how i can check if it is there and if not how I can Install it... Below you'll find the site config file I was working on when I run a2dissite on it Apache Starts up just fine It's only when i enable vboxsf that it fails on startup/reload or whenever runs "configtest" on it's configuration...

Here is /etc/apache2/sites-available/vboxsf.conf

<VirtualHost *:80 *:8080>
  ServerName sandbox
  ServerAlias *.dev

  LogLevel info
  ErrorLog ${APACHE_LOG_DIR}/dev-error.log
  CustomLog ${APACHE_LOG_DIR}/dev-access.log combined

  RewriteEngine On

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>

  <Directory /media/>
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>

  <Location /server-status>
    SetHandler server-status
    Order allow,deny
    Allow from all
    Require all granted
  </Location>

  UseCanonicalName Off
  VirtualDocumentRoot /media/sf_%1
</VirtualHost>

The output from sudo service apache2 reload

 * Reloading web server apache2                                                                                                                                                                                                             *
 * The apache2 configtest failed. Not doing anything.
Output of config test was:
AH00526: Syntax error on line 30 of /etc/apache2/sites-enabled/vboxsf.conf:
Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

And tail /var/log/apache2/error.log

[Wed Mar 04 17:05:43.698449 2015] [mpm_prefork:notice] [pid 1172] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:28:35.880536 2015] [mpm_prefork:notice] [pid 2604] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:28:35.880657 2015] [core:notice] [pid 2604] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:39.675812 2015] [mpm_prefork:notice] [pid 2604] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:40.788348 2015] [mpm_prefork:notice] [pid 2715] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:40.788487 2015] [core:notice] [pid 2715] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:32:58.596151 2015] [mpm_prefork:notice] [pid 2715] AH00169: caught SIGTERM, shutting down
[Wed Mar 04 17:32:59.706649 2015] [mpm_prefork:notice] [pid 2787] AH00163: Apache/2.4.10 (Ubuntu) PHP/5.5.12-2ubuntu4 configured -- resuming normal operations
[Wed Mar 04 17:32:59.706763 2015] [core:notice] [pid 2787] AH00094: Command line: '/usr/sbin/apache2'
[Wed Mar 04 17:49:48.283025 2015] [mpm_prefork:notice] [pid 2787] AH00169: caught SIGTERM, shutting down

Upvotes: 3

Views: 2450

Answers (1)

castis
castis

Reputation: 8223

... or defined by a module not included in the server configuration

You are most likely missing the mod_vhost_alias plugin for apache.

Upvotes: 4

Related Questions