1
votes

I am new to the Homestead and virtualbox/vagrant world. I went through some video tutorials on how to strat working with Homestead. Everything went smoothly until the last step. It says we need to add the IP address mention in the Homestead.yaml file into the hosts file.

I did that, but it always gave me the following error:

This site can’t be reached dev.test refused to connect. Search Google for dev test 8000 ERR_CONNECTION_REFUSED

My hosts file looks something like this: 192.168.10.10 dev.test

But when I use 127.0.0.1 dev.test it works perfectly fine.

I don't know what's happening. Even the official documentation says we should 192.168.10.10 dev.test in the /etc/hosts file.

Where am I going wrong??

Here's my Homestead.yaml file

ip: "192.168.10.10"

memory: 2048

cpus: 1

provider: virtualbox

authorize: ~/.ssh/laravel.pub

keys: - ~/.ssh/laravel

folders: - map: /var/www/Laravel

  to: /home/vagrant/Laravel

sites: - map: dev.test

  to: /home/vagrant/Laravel/test/public

databases: - homestead

1
in Homestead.yaml 192.168.10.10 ?Odin Thunder
screen your hosts, pleaseOdin Thunder
Screen or paste here your Homestead.yaml if you canbretanac93
@bretanac93 I have updated my question with the Homestead.yaml filePritam Bohra
Did you check if you are using the port 8000 in your host OS?, because vagrant maps the ports to the clients, ie: 80 -> 8000, if you have the port 8000 in use in your client, maybe there is some error and the nginx server doesn't execute in your guest.bretanac93

1 Answers

0
votes

Looks like I found my mistake. I was trying to access my web app using port 8000 even after using 192.168.10.10 dev.test in the hosts file. I should have simply used dev.test in the browser to access the web app.

Silly Mistake. I makes perfect sense to use dev.test:8000 in the browser if the hosts file reads 127.0.0.1 dev.test