Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

steeve's avatar

Unable to connect to my new Laravel apps in my browser

I recently installed Homestead and Laravel and, because my project calls for 3 separate applications, I generated 3 Laravel projects in my ~/Code folder (aaa, bbb, ccc) and set my .homestead/homestead.yaml file to the following:

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
     - ~/.ssh/id_rsa

folders:
     - map: ~/Code
        to: /home/vagrant/Code

sites:
        - map: aaa.app
        to: /home/vagrant/Code/aaa/public
        - map: bbb.app
        to: /home/vagrant/Code/bbb/public
    - map: ccc.app
        to: /home/vagrant/Code/ccc/public

databases:
        - homestead

Then I set my /private/etc/hosts file to the following:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##

127.0.0.1       localhost
192.168.10.10   aaa.app
192.168.10.10   bbb.app 
192.168.10.10   ccc.app

255.255.255.255 broadcasthost
::1             localhost

I then tried provisioning, suspending and "uping" Vagrant, but I can never get any of my apps to show up using:

http://aaa.app  or   http://aaa.app:8000   or  aaa.app  or  aaa.app:8000 

The browser either says:

No input file specified.

Sometimes says:

Safari cannot locate the server aaa.app

and oddly sometimes points to localhost/index.php.

Can anyone tell me what I am doing wrong?

0 likes
17 replies
ejdelmonico's avatar

I can't recall but I think you have to run vagrant provision afterward.

steeve's avatar

Thanks, but I did that both directly by running vagrant provision command and by running vagrant suspend and vagrant up several times.

steeve's avatar

Appending :8000 to any of them, simply makes the browser stall.

using

http://aaa.app 

(only) takes me to localhost/index.php , which of course says "It works!", but that's just what it always says by default.

jasrys's avatar

The Homestead.yaml file is pretty finicky with spacing/alignment. Might check to make sure you don't have any tabs (replace with spaces) and that everything is properly aligned.

steeve's avatar

Thanks jarys. I will make sure to check tabs and spacing.

steeve's avatar

jarsys: I checked the spacing/tabs in the .yaml file and everything checks out.

jasrys's avatar

I don't know if this makes any difference, but I only use one line for the 192.168.10.10 entry in /etc/hosts, like this:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost
192.168.10.10 aaa.app bbb.app ccc.app

steeve's avatar

jarsys: interestingly enough, ccc.app worked, but to the exclusion of aaa.app, an bbb.app. They all responded the same.

jasrys's avatar

Did you run the 'vagrant provision' command after updating Homestead.yaml?

If no luck it's either a sign you need to combine the apps into one or need someone with more experience to chime in. ;)

steeve's avatar

I did run vagrant provision several times, including once more after your suggestion. I appreciate your attempt and, as do you, hope others do chime in!

ejdelmonico's avatar

Out of curiosity, you listed your contents of /private/etc/hosts. Does /etc/hosts display the exact same info? It should.

ejdelmonico's avatar

Also, I believe that your host listings should go after:

127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost

steeve's avatar

Thanks ejdelmonico, I'll try both suggestions now. Should I run vagrant provision after each change to with the Homestead.yaml file or the etc/hosts file, or should run I vagrant suspend then vagrant up?

steeve's avatar

As suggested I moved the lines in the hosts file below the 127.0.0.1 localhost 255.255.255.255 broadcasthost ::1 localhost. But to no effect. I also confirmed the changes made to /private/etc/hosts are reflected in /etc/hosts each time.

Below is the update hosts file. If you notice, I moved ccc.app up above bbb.app because it seems to work (I see Laravel 5 on the screen when I access it from the browser, but the other two go directly to localhosts/index.php

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1   localhost
255.255.255.255 broadcasthost
::1             localhost
192.168.10.10   aaa.app
192.168.10.10   ccc.app
192.168.10.10   bbb.app

ccc.app is the last site mapped in the yaml file (see below)

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
        - ~/.ssh/id_rsa

folders:
        - map: ~/Code
         to: /home/vagrant/Code

sites:
    - map: aaa.app
        to: /home/vagrant/Code/aaa/public
        - map: bbb.app
        to: /home/vagrant/Code/bbb/public
        - map: ccc.app
        to: /home/vagrant/Code/ccc/public

databases:
    - homestead

Do you think my mappings are wrong?

steeve's avatar
steeve
OP
Best Answer
Level 3

Update: I finally solved the issue. My machine had to be booted up for some reason, and it is now working properly

Please or to participate in this conversation.