Laravel Homestead with multiple instances, one stating site unreachable - laravel

I am using Laravel Homestead on Windows 10 and my first application runs as 'Homestead' properly at site1.test.
Today I tried creating a second Homestead instance called 'homestead-for-wordpress' at site2.test but it returns an DNS error.
Here is my hosts file:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
192.168.10.10 site1.test
192.168.10.11 site2.test
Here are my Homestead.yaml files:
Site1.test:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/Projects/site1
to: /home/vagrant/site1.test
sites:
- map: site1.test
to: /home/vagrant/site1.test/public
databases:
- homestead
features:
- mysql: true
- mariadb: true
- postgresql: false
- ohmyzsh: true
- webdriver: false
Site2.test (a WordPress site):
---
ip: "192.168.10.11"
name: "homestead-for-wordpress"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/Projects/site2
to: /home/vagrant/site2.test
sites:
- map: site2.test
to: /home/vagrant/site2.test
databases:
- homestead
features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: yes
- webdriver: false

Related

Unable to connect to database using homestead

I'm using homestead globally and I'm getting this error when I'm trying to add my database details to datagrip
The specified database user/password combination is rejected: [28000] FATAL: no pg_hba.conf entry for host "192.168.10.1", user "homestead", database "dogs", SSL on
this is my Homestead.yaml file
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/projects/code
to: /home/vagrant/code
sites:
- map: site1.test
to: /home/vagrant/code/site1/public
- map: site2.test
to: /home/vagrant/code/site2/public
- map: site3.test
to: /home/vagrant/code/site3/public
php: "7.4"
- map: dogs.test
to: /home/vagrant/code/dogs/public
php: "7.4"
databases:
- site1
- site2
- site3
- dogs
features:
- mysql: true
- mariadb: false
- postgresql: true
- ohmyzsh: false
- webdriver: false
#services:
# - enabled:
# - "postgresql#12-main"
# - disabled:
# - "postgresql#11-main"
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
and what I have in my datagrip when I try to connect
Host: 192.168.10.10
Port: 5432
Authentication: User & Password
User: homestead
Password: secret
Database: dogs
Had the same problem once. I was working with grafana local at the time. Some setups which use postgresql cannot work properly localy with the 10.10 adress.
My fix was changing the ip of my vagrant box to 10.11 .
this fixed the issue.
And if you want to revert that for other project's you can easily do:
#ip: "192.168.10.11"
ip: "192.168.10.10"
Not sure if this will be the solution for your problem. But worth a try

Laravel Homestead Not Accepting Key Pairs

I have just started trying to set up an instance of homestead. I have been successful so far but I am a bit confused on the current step. I am on a windows machine so have mapped my homestead.yaml ssh key paths to the full windows paths and have confirmed their existence/location. Now when I attempt to ssh into my vagrant box, I am prompted for a password. The default "vagrant" password works but I was under the impression that the ssh keys would handle my sign on.
Here is a look at my homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox //This is my provider
authorize: C:/Users/me/.ssh/id_rsa.pub
keys:
- C:/Users/me/.ssh/id_rsa
folders:
- map: C:/PROGRA~1/Laravel/Homestead/projects/website
to: /home/vagrant/projects/website
sites:
- map: website.test
to: /home/vagrant/code/website/public
databases:
- website
features:
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
If you are on a windows machine you need to fix your slashes.
authorize: C:\Users\me\.ssh\id_rsa.pub
keys:
- C:\Users\me\.ssh\id_rsa
folders:
- map: C:\PROGRA~1\Laravel\Homestead\projects\website
to: /home/vagrant/projects/website
and the rest is correct.

Vagrant This site can’t be reached

I have tried to setup vagrant for my project but I cannot connect to my localhost website. I already set up in /etc/hosts/ file. Try everyone vagrant command I can like
vagrant up
vagrant reload
but I can't connect to my localhost . Does anybody know how to fix it
My yaml config
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: D:/Work/crm
to: /home/vagrant/code/crm
sites:
- map: crm.local
to: /home/vagrant/code/crm/public
databases:
- homestead
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
vagrant up last log
Add 192.168.10.10 to your hosts file.
For example if you're using Windows, you will find the hosts file in "C:\Windows\System32\drivers\etc\hosts" this path.
At the end of the file you can add it. Something like this
192.168.10.10 laravel.test
Hope this helps.

No input file specified on vagrant vm

First off: I'm new to using Laravel. I got the homestead VM up and running with Vagrant. I checked my Homestead.yaml file and it checks out, did the additions to the hosts file as well, and created my blog according to the video tutorials on the VM.
When I run the command "php artisan serve" and try the address it returns, I get an error saying "No input file specified".
Anyone have a fix for this?
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/JeromePapalie/LaravelCode
to: /home/vagrant/Code/Laravel
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
First, you need to check the folder structure.
This is my folder structure.
Here my Homestead.yaml file
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: /Users/kelvin/.ssh/kevin.pub
keys:
- ~/.ssh/kevin
folders:
- map: ~/Documents/Work/kevindev/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
Hope, you already generated ssh key file in your target folder something like this.
And then, open your host vim /etc/hosts and add your homestead.app host
Finally, go to your Homestead folder and type vagrant up command.
That's is.

Homestead on windows, not accessible trough browser

I'm trying to set up a homestead machine on my Windows8 PC, for Laravel development. I have managed to get the machine up and running, I can SSH into it.
But somehow visiting http://homestead.app doesn't work.
I returns "This web page is not available".
I added this line to my hosts file:
192.168.10.10 homestead.app
My Gitbash did say at a certain piont: "Warning: Connection timeout. Retrying..." But continued anyway.
This is how my Homestead.yaml looks like:
---
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: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: udp
You can redirect your request to your host port and with your host machine you would be able to access you app.

Resources