- On the guest machine add all sites to
/etc/apache2/sites-available/000-default.conf
. Example:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/foo
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName foo.localhost
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/bar
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerName bar.localhost
</VirtualHost>
-
Restart apache
sudo systemctl reload apache2
-
On the host machine edit your
/etc/hosts
file:
192.168.33.10 foo.localhost
192.168.33.10 bar.localhost
See IP from your Vagrant config (Vagrantfile)