How does Homestead/Vagrant virtual hosts recognize all 192.168.10.10 projects ?
hello,
I know the title of my question sounds pretty weird, but I'll try to explain it...
I use Homestead to hosts my Laravel projects (Symfony as well), but in my hosts file (on my mac), I gave 192.168.10.10 as the adress for everyone of my projects, and in the homestead.yaml i gave the full path of the project.
When I simply go to 192.168.10.10, I get to a specific project, but how does that happen ?
How can I know the exact ip address of a particular project in Homestead ?
(It's kind of a network basic question, but I get stuck in a Symfony 3 project because i try to allow access to 192.168.10.10 and that doesn't work because it points to another project)
A server can host multiple websites under the same IP. You do this by setting up a virtual host (i.e. configuring some file(s) for Apache or Nginx). Basically, you tell the server that when someone visits your server (192.168.10.10) via the domain coolsite.com, it should point them to /var/www/coolsite. But when another user tries to find someothersite.com, then it should point to /home/naspy971/someothersite instead.
Homestead allows you to configure the sites (tell the server which domains should point to which directories) through Homestead.yaml. You then need to open up your own hosts file and point the domains to Homstead's IP (192.168.10.10). You should set a fake domain (e.g. mysite.test) for your project, not visit the IP directly (because they all share the same server IP).