Closed dixhuit closed 8 years ago
So when you access a Vlad box via the IP address you will almost always get the adminer subdomain. Why? Basically because Apache doesn't know what the address is for it will serve the first site it has in it's alphabetically sorted list of virtual hosts. Which happens to be adminer (unless you've called your site aardvark.local or something). For this reason it's best to call Apache with the correct DNS address.
So a couple of solutions come to mind. 1) Alter the hosts file on the other VMs so that you can reference the correct site with the correct name. 2) Use something like Charles Proxy (http://www.charlesproxy.com/) to create a middleman between your test VM and the Vlad VM. This might need some configuration/tweaking, but I think it should work. 3) Vagrant share.
I thought it might be to do with alphabetical defaults. Thanks for the info, I will look into this further!
You could always run sudo a2dissite adminer.local.conf
to turn off the adminer sub domain.
That's a good idea.
If adminer is not installed, the sub domain is not created right?
True :)
OK, cool. More options :)
FWIW - the 'common' approach here is to rename the default vhost conf file to 000-default.conf - that way it is the first in the list and serves up the default site for the ip address with no host header. I also typically create a default holding page (one page) to use in place of the standard - 'It Works' page.
That sounds even better :)
Good point @iAugur. This is also a good way of "catching" traffic that hits the Apache server via the IP address which you can redirect to a domain name of some sort.
Vagrant share is another option -- https://www.vagrantup.com/docs/share/
Also good for mobile testing.
Yeah, I've used Vagrant Share (also suggested by Phil further up) and it's great but I was particularly interested in something local and not having to mess about with unique generated URLs (there's a lot to be said for having a local site bookmarked in a number of different browsers/devices when testing).
Anyways, I recently committed https://github.com/hashbangcode/vlad/commit/0ec9603b77d5457885eb0db7195b02069028ce0f which fixes this particular issue.
IE testing using VMs is probably the nicest way to go about it today (it's still horrid, this is all relative). Microsoft make this easier these days thanks to the VMs available at Modern IE. VirtualBox also seems to come with its own "smart" networking out of the box in that you can access a page served from one guest VM via another guest VM if they're both on the same host.
Regarding that last point, the closest I can get with Vlad is to type in the IP address of the Vlad VM (as a browser URL from the Windows VM), doing so will load the Vlad VM's Adminer subdomain by default (not much help). Is there something we can do to improve this?