[Ubuntu] Invalid command 'VirtualDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration

When i set the virtualhost as: 

VirtualDocumentRoot /var/www/%1
<VirtualHost *:80>
   DocumentRoot /var/www
   ServerName myhost


I got these error:

Syntax error on line 33 of /etc/apache2/sites-enabled/000-default:
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.


After googling, i found that i forgot to enable the vhost_alias.load module in apache!

Just follow these:

sudo ln -s /etc/apache2/mods-available/vhost_alias.load /etc/apache2/mods-enabled


Have fun with Ubuntu! 




posted @ 2012-11-13 12:04 DavidHHuan 阅读(...) 评论(...) 编辑 收藏