12

When I goto my host ao.dev:8000 or ao.dev, "this site can't be reached,ao.dev refused to connect" is displayed.

My yaml file:

enter image description here

also i've my view file:

i've checked:

enter image description here

I've run vagrant up command by going to Homestead directory .

Also see: https://stackoverflow.com/questions/38801375/vagrant-up-not-forwarding-all-portshomesteadlaravel-5-2windows-10

Community
  • 1
  • 1
YaSh Chaudhary
  • 2,605
  • 8
  • 37
  • 74

5 Answers5

3

Actually I was using WAMP before installing homestead. So I uninstalled both i.e. wamp and homestead setup including vagrant and virtual box. Then I installed homestead setup again and it worked. I dont know the logic behind but maybe wamp and homestead were conflicting. It worked so I posted the answer.

YaSh Chaudhary
  • 2,605
  • 8
  • 37
  • 74
2

What I needed to do to get my local Laravel up and running:

  • use 127.0.0.1 rather than 192.168.10.10 in my hosts file
  • make sure the .env file had the correct hostname listed as the APP_URL
  • make sure to use the :8000 port to access the site

Additionally:

  • if you're adding multiple sites, make sure to run vagrant provision after adding each site to your Homestead.yaml
  • not sure if it makes a difference, but you might want to put a space after the colon for the map command, i.e. map: ao.dev
  • I did not need to add hostname or name elements to Homestead.yaml
Leith
  • 3,139
  • 1
  • 27
  • 38
1

Here is an example Homestead.yaml file from one of my own projects:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
hostname: vm
name: vm
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: "."
      to: "/home/vagrant/example"

sites:
    - map: example.dev
      to: "/home/vagrant/example/public"

databases:
    - example

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

Notice how my paths are double-quoted (to: "/home/vagrant/example")? In your code above, these paths are not double-quoted as they should be.

I also recommend after you fix your configuration that you completely destroy and re-create your VM by running:

vagrant destroy -f && vagrant up

In your Laravel project root directory.

Jamesking56
  • 3,683
  • 5
  • 30
  • 61
0

Your Vagrant VM machine is up but you can't reach to the machine.

Can you paste your hosts file on your host machine?

Can you paste the output of a "nmap 192.168.10.10" from your host machine?

Can you paste "ls /etc/nginx/sites-enabled/ -la" on your Vagrant VM machine?

Jesús Amieiro
  • 2,443
  • 21
  • 15
  • are you talking about virtualbox?...yes it says failed to open session for virtual machine..... – YaSh Chaudhary Aug 02 '16 at 17:40
  • Your Vagrant VM is up. The http://i.stack.imgur.com/Unn5W.png is the Vagrant VM shell. Can you paste this 3 elements, so I can take a look and see what is happening? – Jesús Amieiro Aug 02 '16 at 19:40
  • ls /etc/nginx/sites-enabled/ -la gives: total 8 drwxr-xr-x 2 root root 4096 Jun 27 16:55 . drwxr-xr-x 6 root root 4096 Jun 27 16:55 .. – YaSh Chaudhary Aug 03 '16 at 04:07
  • I've this in hosts file: 127.0.0.1 localhost 192.168.10.10 homestead.app 192.168.10.10 ao.dev – YaSh Chaudhary Aug 03 '16 at 04:09
  • nmap 192.168.10.10 gives: Starting Nmap 7.01 ( https://nmap.org ) at 2016-08-03 08:46 UTC Nmap scan report for 192.168.10.10 Host is up (1.0s latency). Not shown: 987 closed ports PORT STATE SERVICE 25/tcp open smtp 110/tcp open pop3 119/tcp open nntp 135/tcp open msrpc 139/tcp open netbios-ssn 143/tcp open imap 445/tcp open microsoft-ds 465/tcp open smtps 563/tcp open snews 587/tcp open submission 993/tcp open imaps 995/tcp open pop3s 5357/tcp open wsdapi Nmap done: 1 IP address (1 host up) scanned in 27.84 seconds – YaSh Chaudhary Aug 03 '16 at 08:47
  • @YaShChaudhary the nmap doesn't show the HTTP port open (80, 443, 8080), so you have some problem with your HTTP server or some firewall/antivirus is blocking the connection. – Jesús Amieiro Aug 03 '16 at 09:13
  • Try to provision the Vagrant VM "vagrant reload --provision". Take a look at this post http://www.jesusamieiro.com/how-to-add-a-new-project-in-laravel-homestead/ – Jesús Amieiro Aug 03 '16 at 10:04
  • this is empty:vagrant@homestead:/etc/nginx/sites-enabled$ ls – YaSh Chaudhary Aug 03 '16 at 10:15
  • @YaShChaudhary if you have this directory empty this means that you have a problem provisioning the Vagrant VM, because you haven't any site enabled in the nginx. – Jesús Amieiro Aug 03 '16 at 10:48
  • so how to enable site? – YaSh Chaudhary Aug 03 '16 at 10:51
0

I had the same problem, I installed and run fiddler and it was enough to solve it.

Yevgeniy Afanasyev
  • 37,872
  • 26
  • 173
  • 191