Laraveldeep's avatar

Ping to Homestead is Fine But Connection Refused

Hi,

I have setup the L5.7 Homestead on my Windows 10 machine and did the vagrant up but I can't open the site.

I am getting www.myapp.local refused to connect. on browser. I do have entry on hosts file

192.168.10.10 www.myapp.local

Pinging on 192.168.10.10 however is fine.

Details (gitbash):

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Checking if box 'laravel/homestead' version '7.1.0' is up to date...
==> homestead-7: Clearing any previously set forwarded ports...
==> homestead-7: Clearing any previously set network interfaces...
==> homestead-7: Preparing network interfaces based on configuration...
    homestead-7: Adapter 1: nat
    homestead-7: Adapter 2: hostonly
==> homestead-7: Forwarding ports...
    homestead-7: 80 (guest) => 8000 (host) (adapter 1)
    homestead-7: 443 (guest) => 44300 (host) (adapter 1)
    homestead-7: 3306 (guest) => 33060 (host) (adapter 1)
    homestead-7: 4040 (guest) => 4040 (host) (adapter 1)
    homestead-7: 5432 (guest) => 54320 (host) (adapter 1)
    homestead-7: 8025 (guest) => 8025 (host) (adapter 1)
    homestead-7: 27017 (guest) => 27017 (host) (adapter 1)
    homestead-7: 22 (guest) => 2222 (host) (adapter 1)
==> homestead-7: Running 'pre-boot' VM customizations...
==> homestead-7: Booting VM...
==> homestead-7: Waiting for machine to boot. This may take a few minutes...
    homestead-7: SSH address: 127.0.0.1:2222
    homestead-7: SSH username: vagrant
    homestead-7: SSH auth method: private key
==> homestead-7: Machine booted and ready!
==> homestead-7: Checking for guest additions in VM...
==> homestead-7: Setting hostname...
==> homestead-7: Configuring and enabling network interfaces...
==> homestead-7: Mounting shared folders...
    homestead-7: /vagrant => D:/DATA/SourceCodes/Homestead
    homestead-7: /home/vagrant/code => D:/DATA/SourceCodes/laravel
==> homestead-7: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> homestead-7: flag to force provisioning. Provisioners marked to run always will still run.

Ping details from windows command prompt:

Pinging 192.168.10.10 with 32 bytes of data:
Reply from 192.168.10.10: bytes=32 time<1ms TTL=64
Reply from 192.168.10.10: bytes=32 time<1ms TTL=64
Reply from 192.168.10.10: bytes=32 time<1ms TTL=64
Reply from 192.168.10.10: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.10.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

I am sure it is a minor issue but can't figure out.

0 likes
2 replies
latz's avatar

Login to homestead with ssh. Is nginx running?

Laraveldeep's avatar

Looks its fine

vagrant@homestead:~$ systemctl status nginx
? nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2019-02-27 05:55:12 UTC; 59min ago
     Docs: man:nginx(8)
  Process: 861 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 613 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 866 (nginx)
    Tasks: 2 (limit: 2319)
   CGroup: /system.slice/nginx.service
           +-866 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           +-867 nginx: worker process

Feb 27 05:55:11 homestead systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 27 05:55:12 homestead systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Feb 27 05:55:12 homestead systemd[1]: Started A high performance web server and a reverse proxy server.

Not sure though why nginx.pid parse failed

vagrant@homestead:~$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Please or to participate in this conversation.