Closed johnbburg closed 8 years ago
Are you sure you want a separate vhost? If it's for Drupal multisite what you need is a separate host definition in your /etc/hosts
file (Unix) or the equivalent on Windows. You might want a separate vhost if you were looking to get an entirely separate system -- say xhgui -- to coexist with Drupal. I'll admit this is an area that has not been well (at all?) tested.
Original question was for server aliases, asking about vhosts out of curiosity as I've wondered about the issue and may have a not so far-fetched use case for it as well.
Use Case; I have a set of sites that I do work on very often. Each with their own VMs. To work on one, I must halt the VM of any others. Boot that VM, and access the site. I do have the ability to forward the ports of one to different values to avoid any clashes, but leads to performance issues on my host machine, to have multiple VMs running at the same time.
Whaat about having a meta-VM running, with multiple projects accessible through different virtual hosts/server blocks? Just a thought. I also had this very question from someone earlier this week.
It should be possible though, again, it hasn't been tested, since you can define multiple vhosts, multiple databases and multiple Solr collections. The reason we went for more substantial isolation is due to the significant potential variability between environments. Anything from PHP versions to cache servers to Varnish or DB configuration can and have been different between sites.
What is the correct syntax for adding server aliases and virtual hosts? I'm looking at setting up a Drupal Multisite, which depends on the URL name to serve an individual multi-site instance.
Although, while typing this, I'm just realizing that since the VM captures all hostnames via wildcard *. Any entry in the host machine's /etc/hosts that points to 127.0.0.2, and accessed via the VM's forwarded port (8080 or 8081), should be able to hit the site in the VM. Leaving the issue for the benefit of others though.
But I am still curious about how to add a separate Vhost configuration altogether?