Create dynamic virtual hosts with Apache2

Posted on

It consists to create a directory named www.mywebsite.local and having access directly through your browser at this URL. Consider using it in a development environment.

First, install vhost_alias module for apache2.

sudo a2enmod vhost_alias

Then put in /etc/apache2/sites-available/vhost.conf :

<VirtualHost *:80>
UseCanonicalName Off
LogFormat "%V %h %l %u %t "%r"" %s %b"" vcommon

Leave a Reply

Your email address will not be published.