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

lsutiger's avatar

Homestead Host Setup

I was hoping someone may point me in the right direction. I have watched a few videos here about setting up Vagrant and Homestead and decided to give it a try. I was previously using MAMP. I am using a Mac running Yosemite and use Chrome.

Before watching the videos and setting up homestead and vagrant, I had set up my site with Laravel 4.2 ... ~/documents/webdev/mysite/html I could bring up the laravel page with MAMP on localhost:8888. After watching the homestead/vagrant videos, I installed the components. Some of the videos appear to contradict one another where adding to your /etc/hosts file.

Homestead and Vagrant seem to work fine. Homestead is located in ~/.homestead. There is a link in my ~.composer/vendor/bin/ to the homestead location. My path contains the .composer/vendor/bin. 'Which homestead' returns ~/.composer/vendor/bin/homestead. I can 'homestead up' and the only snag occurs when it is bringing up Vagrant. I get about 5 or 6 ' Warning: Connection timeout. Retrying...' before I get the ''Machine booted and ready!" notice. I can homestead ssh and log in just fine. For reference, my homestead.yaml file contains:

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

authorize: /Users/AREA_MAC/.ssh/id_rsa.pub

keys:
    - /Users/AREA_MAC/.ssh/id_rsa

folders:
    - map: ~/Documents/webdev
      to: /home/vagrant

sites:
    - map: igrainbin.app
      to: /home/vagrant/mysite/html/public

databases:
    - test

variables:
    - key: APP_ENV
      value: local

I changed my hosts file as shown below.

127.0.0.1 localhost
255.255.255.255 broadcasthost
::1             localhost
fe80::1%lo0 localhost
192.168.10.10 mysite.app

When I attempt to access the site (mysite.app) in Chrome, I get a 'not found' error. I have also trie the ip address to which it is mapped.

I hope I have given adequate information. Can someone help me out here? Thanks!

0 likes
6 replies
xingfucoder's avatar

Hi @lsutiger, you need to use the same server name as you specified within your site paths of the yaml file.

In your example would be 192.168.10.10 igrainbin.app or if you want to use mysite.app you should use:

sites:
    - map: mysite.app
      to: /home/vagrant/mysite/html/public
lsutiger's avatar

Hey @codeatbusiness .. thanks for the reply! I have struggled with this for three days before. That was silly of me. I changed homestead.yaml from igrainbin to mysite and still no luck. Actually I had tried two sites thinking I messed something up the first go-round and that was the result of a forgotten replacement after creating the second. My .yaml file is now ...

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

authorize: /Users/AREA_MAC/.ssh/id_rsa.pub

keys:
    - /Users/AREA_MAC/.ssh/id_rsa

folders:
    - map: ~/Documents/webdev
      to: /home/vagrant

sites:
    - map: mysite.app
      to: /home/vagrant/mysite/html/public

databases:
    - test

variables:
    - key: APP_ENV
      value: local

It still does not work. I still get the not found error navigating to mysite.app/. It is a 404 nginx error so the server is running. I also tried going to 192.168.10.10 with the same result. When I try 192.168.10.10:8000, I get a browser webpage not available (not an nginx error). If I halt homestead and bring up MAMP, it works at http://localhost:8888/ but not mysite.app/ Any other ideas?

bashy's avatar

Does "to: /home/vagrant/mysite/html/public" exist? Nginx 404 will be because it can't find the directory you tell it (for the root).

xingfucoder's avatar

Did you run the provision command? If you make any change within the site paths of the yaml file, you should run this command to update the sites.

Try running:

serve yourdomainappname.app /home/vagrant/Code/path/to/public/directory

Use your domain name and your path of the public directory within your Virtual Machine.

1 like
lsutiger's avatar

Pasting "to: /home/vagrant/mysite/html/public" does not do anything locally but directs me to Google with that term as a search. If i "homestead ssh", log in, and from the vagrant@homestead:~$ prompt I enter "cd /home/vagrant/mysite/html/public", I get the prompt vagrant@homestead:~/mysite/html/public$.

lsutiger's avatar

@codeatbusiness, no, I have done nothing further than follow the installation aside from making changes to the .yaml file. At my shell prompt I entered:

serve mysite.app /home/vagrant/mysite/html/public

I get a 'command not found: serve'

Please or to participate in this conversation.