Homestead setup does not work - laravel

I installed homestead and laravel 5.3
Now I want to setup my homepage and access it locally. Therefore I created this YAML file:
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/Development/Source/MFServer
to: /home/vagrant/Development/Source/MFServer
sites:
- map: loc.medifaktor
to: /home/vagrant/Development/Source/MFServer/public
databases:
- homestead
and the hosts file:
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
192.168.10.10 loc.medifaktor
But when I access loc.medifaktor I get the error:
This site can’t be reached loc.medifaktor’s server DNS address could
not be found.

The folders: attribute is meant as a root folder for all your projects. Change it to:
- map: ~/Documents/Development/Source
to: /home/vagrant/Development/Source
Make sure your MFServer project is installed in the Source folder, so basically like your site mapping now says.
Then reload & provision homestead with vagrant reload --provision or homestead reload --provision if you've defined an alias.
If you now ssh into homestead, your project's source code should be available in /Development/Source/[project]

Related

Laravel project wont serve to given ip via Homestead

I am having trouble setting up my laravel project on my mac. I have (As far as I can tell) set up the homestead.yaml config correctly within my Homestead directory:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Documents/GitHub/project-darwin
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/public
php: "7.2"
databases:
- homestead
After I have used vagrant up, on using vagrant ssh I can see my project inside of vagrant/code/project-darwin.
My hosts file is as follows:
##
# 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 homestead.test
Which looks correct as is no different to what I normally do when running other laravel projects on virtualbox, however on going to my url, I get a 500 error and the same applies if I go directly to the ip (198.168.10.10).
A further thing I find suspicious is the following. When I use vagrant up, this is part of what shows in my terminal:
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
Should this ip be the same as the ip I supplied? Anyway, I have run out of ideas as to how to go about fixing this, any suggestions?
So it turns out my mac had auto selected . hyperv as my provider when I ran vagrant box add laravel/homestead, oh well..
In your Homestead.yaml config file you are doing the following:
Making a shared folder mapping project-darwin to /home/vagrant/code
folders:
- map: ~/Documents/GitHub/project-darwin
to: /home/vagrant/code
But under sites you are mapping the folder /home/vagrant/code/public to homestead.test, meaning when you are requesting homestead.test or the IP of your Vagrant Box, you are not calling upon project-darwin but rather the "empty" public folder.
sites:
- map: homestead.test
to: /home/vagrant/code/public
I would recommend either moving your code to the public folder or mapping sites to your desired destination.
Hope this helps :)

can't find downloaded laravel files in mapped homestead folder

i just set up homestead and made sure that my folder is mapped correctly( by displaying some php content ), but when i download laravel from the virtual machine i can't find the files in the mapped folder.
homestead.yaml :
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: C:/Users/neo/Code
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: fresh.app
to: /home/vagrant/Code/fresh/public
databases:
- homestead
- fresh
hosts:
127.0.0.1 localhost
127.0.0.1 localhost
192.168.10.10 fresh.app
Make sure your laravel homestead is in your home root's directory. Also
Change your
- map: C:/Users/neo/Code
to
- map: /Users/neo/Code
Then in your Homestead environment run command:
vagrant reload --provision
It should work fine now and map your folder.

The web.app page isn’t working

When i try to open web.app it doesnt work. But vagrant up running successfully. Hier is my Homestead.yarn file
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/www
sites:
- map: web.app
to: /home/vagrant/www/web
databases:
- homestead
I'm using Mac OS.
laravel box : laravel/homestead (virtualbox, 1.1.0)
in hosts 127.0.0.1 web.app (192.168.10.10 and 127.0.0.1 both doesn't work)
vagrant and homestead are up to date. Any idea?
web.app:8000 doesn't work else
First on your homestead.yaml file, make the following changes
folders:
- map: ~/www/web
to: /home/vagrant/www/web
sites:
- map: web.app
to: /home/vagrant/www/web/public
Then go to your Homestead folder and do
vagrant reload --provision
After reloading do
vagrant up
Then edit the /etc/hosts file and add the following line
192.168.10.10 web.app
Now you should get laravel homepage when you hit web.app on your browser
I don't know why but my hosts file is ignored. Therefore i used just 192.168.10.10 instead web.app after 10 hour i fixed the problem. just deleted hosts file and created it again.

Homestead is not loading the page

I'm new to homestead and I have encountered problems while installing it
I can't use
vagrant up
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
so I tried to install cloud base as I'm using Fedora 25 64 bit
https://atlas.hashicorp.com/fedora/boxes/25-cloud-base
and now I'm able to up my vagrant but once I try to ping my homestead.app
all packets are lost and also I can't access it
I'm running xampp in case it makes any differences
here is my /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
192.168.10.10 homestead.app
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
here is my homestead.yaml
ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/projects
to: /home/vagrant/projects
sites:
- map: homestead.app
to: /home/vagrant/projects/demo/public
databases:
- demo
I suggest you to not use xampp with Homestead. Homestead comes with a full development environment including nginx server.
Install Homestead following this guide Laravel Homestead
Once installed and properly configured, run vagrant up, then vagrant ssh. Do not miss to configure your nginx server to serve your application.
Hope it helps.

Laravel Homestead - No input file specified?

I am trying to install a Homestead VM for Laravel development on Debian Linux 8 with Vagrant 1.8.4 and VirtualBox 5.0.24 r108355.
Following the official documentation, I have installed Homestead and configured it in Homestead.yaml in the following way:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Code/dev.todoparrot.com
to: /home/vagrant/Code
sites:
- map: dev.todoparrot.com
to: /home/vagrant/Code/dev.todoparrot.com/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
To test it with a sample file, I have created an index.php in /home/user/Code/dev.todoparrot.com/public/ on my local machine that echos a string:
<?php echo "Hello from Homestead!"; ?>
I have also added dev.todoparrot.com to /etc/hosts:
127.0.0.1 localhost
127.0.1.1 debian
192.168.10.10 dev.todoparrot.com
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
Within the Homestead folder of my local machine, the VM starts both via vagrant up and vagrant up --provision, but when I visit the domain http://dev.todoparrot.com/ in the browser, I get the following error:
No input file specified.
Any idea what could be wrong?
No input file specified
It says that you don't have any file in
/home/vagrant/Code/dev.todoparrot.com/public
For now, your Vagrant path is
/home/vagrant/Code/dev.todoparrot.com/
And you looking for dev.todoparrot.com/public in dev.todoparrot.com
That's your issue
You need change
folders:
- map: ~/Code/dev.todoparrot.com
to: /home/vagrant/Code
to:
folders:
- map: ~/Code
to: /home/vagrant/Code
It will emulate all folders in Code to /home/vagrant/Code/
Run vagrant up --provision after every update of Homestead.yaml
And in the future, you need to change/add only
sites:
- map: project-name.app
to: /home/vagrant/Code/ProjectName/public
Use vagrant ssh to check your current folders structure inside Code
If you already tried
vagrant up --provision
and still you getting 'No input file specified' error, try to run
vagrant reload --provision
reload vagrant box works for me.

Resources