Homestead not working properly - macos

I have installed vagrant on my machine. I have homestead installed both globally and in my project.
When I run vagrant up it does not work, I am unable to access the url in my browser, it comes up with a blank screen.
So I searched online and found a solution that allowed me to use homestead up by editing my ~/bash_profile and adding the following code:
function homestead() {
( cd ~/Workspace/homestead && vagrant $* )
}
Now when I navigate to my project director and run homestead up it works I am able to access the site via the url in my browser however I encountered another issue, it seemed to be loading from the global homestead.yaml file instead of my project's homestead.yaml file.
When I removed the site from my global homestead.yaml file and put it in my project's homestead.yaml file I kept getting no
input file specified
This is my project's homestead.yaml file:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
hostname: blog
name: blog
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: "~/Workspace/blog"
to: "/home/vagrant/workspace/blog"
sites:
- map: blog.app
to: "/home/vagrant/workspace/blog/public"
databases:
- blog
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
And this is my global homestead.yaml file:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Workspace
to: /home/vagrant/workspace
sites:
- map: homestead.app
to: /home/vagrant/workspace/Laravel/public
databases:
- blog
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp

Don't forget to flag --provision after you edited your .yaml file, so
homestead up --provision
OR
homestead reload --provision
Furthermore in your global Homestead.yaml you're syncing also the Homestead folder with the virtual box, that doesn't make much sense.
I would leave that apart and change it's path to ~/Homestead/ so your ~/Workspace/ will contain only the projects.
so change your bash profile accordingly, and change your Homestead.yaml file to reflect this (if you want to run multiple projects on the same box you won't need "projet" yaml file, but just the hometead global yaml file):
folders:
- map: ~/Workspace
to: /home/vagrant/workspace
sites:
- map: homestead.app
to: /home/vagrant/workspace/Laravel/public
- map: blog.app
to: /home/vagrant/workspace/blog/public
Hope this help
Cheers

Related

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 "No input file specified " on Name.app

I looked at a lot of the other issues but none of those answers were solving my issue.
I'm using Laravel Homestead, and I cannot connect to the .app when I set up the server.
When I initially installed homestead, no Code folder was created, so I put the files into the Code folder manually (and tried just changing the yaml file to not look for /Code/wavvve as well).
Looking for some guidance to see what I can try next, here is the current yaml file
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
mariadb: true
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:\Users\Nick\Documents\GitHub\wavve
to: /home/vagrant/Code/wavvve
sites:
- map: wavvve.app
to: /home/vagrant/Code/wavvve/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
192.168.10.10
My current directories are the following:
C:\Users\Nick\Documents\GitHub\Homestead\Homestead
C:\Users\Nick\Documents\GitHub\wavve
on my VagrantBox my directories are as follows
/home/Code/wavvve
/home/wavvve
I manually made the Code folder to try to resolve the issue, when I first installed and set up everything, I have no code folder inside the directory.
I have tried starting with vagrant up --provision and I haven't had any success with it, and I'm not really sure where to go from here.

Laravel 5.2 - Homestead same site loading for every domain

For whatever reason I cannot get multiple sites to work with Homestead. Every new site added, returns the same site when I visit it in the browser
I have tried every "solution" I have come across here on stack as well as on larvel.io. None of them solve the problem. Any help would be greatly appreciated.
Below are the contents of both my .yaml file and my hosts file.
Local Directory Structure:
Root directory = WWW
project1 = WWW/project1
project2 = WWW/project2
Homestead.yaml:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/WWW
to: /home/vagrant/Code
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
databases:
- project1_db
- project2_db
variables:
- key: 'APP_ENV'
value: 'local'
- key: 'APP_DEBUG'
value: 'true'
# blackfire:
# - id: foo
# token: bar
# client-id: foo
# client-token: bar
# ports:
# - send: 93000
# to: 9300
# - send: 7777
# to: 777
# protocol: ump
/etc/hosts file:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.10.10 project1.app
192.168.10.10 project2.dev
I have tried the following:
vagrant provision
vagrant reload --provision
Destroyed box and vagrant up
vagrant global-status, followed by vagrant provision vm#
have also tried to map folders and sites
ex:
folders:
- map: ~/WWW/project1
to: /home/vagrant/Code/project1
- map: ~/WWW/project2
to: /home/vagrant/Code/project2
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
First, one tip: use nfs because windows folder share is very very slow. To add support for this feature on Windows you should install vagrant-winnfsd
vagrant plugin install vagrant-winnfsd
folders:
- map: ~/WWW
to: /home/vagrant/Code
type: nfs
Just in case remove the slash before the site hostname. I don't have sure if this is the reason but was the only thing wrong I found in your configuration.
sites:
- map: project1.app
to: /home/vagrant/Code/project1/public
- map: project2.dev
to: /home/vagrant/Code/project2/public
Another tip: install the vagrant-hostsupdater plugin to add the hostnames to your hosts file automatically.
vagrant plugin install vagrant-hostsupdater
in you Homestead.yaml file:
aliases: ["project1.app", "project2.dev"]
in scripts/homestead.rb file:
config.hostsupdater.aliases = settings["aliases"]
My files: homestead.rb and Homestead.yaml
Got it.
The slashes before the domain where causing the issue.
Changed this:
sites:
- map: /project1.app
to: /home/vagrant/Code/project1/public
- map: /project2.dev
to: /home/vagrant/Code/project2/public
To this:
sites:
- map: project1.app
to: /home/vagrant/Code/project1/public
- map: project2.dev
to: /home/vagrant/Code/project2/public

Laravel homestead doesn't respond

I just set up my vhost for testing purposes. I've been using vagrant before, but it was for symfony project. The problem is that my server doesn't respond.
my Homestead.yaml file:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/trust_a_skill.pub
keys:
- ~/.ssh/trust_a_skill
folders:
- map: c:/xampp/htdocs/trust_a_skill
to: /home/vagrant/trust_a_skill
sites:
- map: trustaskill.local
to: /home/vagrant/trust_a_skill/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
I also configuted my system(windows) host file
192.168.10.10 trustaskill.local
I already have tried curl'ing http://trustaskill.local:8000/ and 192.168.10.10
Any thoughts what Am i doing wrong here? I just followed documentation on laravel site. My ssh work's just fine. Thanks in advance!
do
vagrant provision
in your Homestead folder.
and you might want to check if you use tab instead of space in your Yaml file. Yaml file is so sensitive and it some issues with tabs.
After you edit the Homestead.yaml file you need to do
homestead provision
and edit your host file adding
192.168.10.10 trustaskill.local
in mac
sudo nano /private/etc/hosts

Resources