The web.app page isn’t working - laravel

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.

Related

Second Vagrant Site Returns Empty Response

I have a vagrant/homestead setup with two sites.
The first one works as expected, but when I started up the server today the second one is just returning a 200 status with no body:
My Homestead file is as follows
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: site1.test
to: /home/vagrant/code/site1-backend/public
- map: site2.test
to: /home/vagrant/code/site2-backend/public
databases:
- dbname
My hosts file is
192.168.10.10 site1.test
192.168.10.10 site2.test
Notes / Things I've Tried
If I stop the vagrant I no longer get the 200 response so it is definitely connecting to it
Any URL I go to at site2.test returns the empty 200 result
Going to site3.test does not connect
I am using Laravel in both projects, but there is no recent output in the Laravel logs
On Vagrant /var/log/nginx/site2.test-error.log is empty as is /var/log/nginx/error.log
Both projects have identical .htaccess files
Both projects have vagrant as the owner for all files
I have run
> vagrant destroy && vagrant up
To no avail.
I'm not sure how to further debug this issue.
This turned out to be an error in my Laravel .env file
Changing
APP_NAME=App Name
to
APP_NAME="App Name"
Fixed it. I was unable to find any logging to this effect and worked it by comparing my setup with my live server.

Homestead / Vagrant not provisioning or serving additional sites

I'm attempting to run multiple sites in my Homestead box, wordpress.dev and responsible.dev. However, upon navigating to http://responsible.dev it displays the content from wordpress.dev.
I've set up the sites in my Homestead.yaml and hosts file, and ran various attempts of:
vagrant provision
vagrant provision <vm_id>
vagrant reload --provision
vagrant destroy followed by vagrant up
vagrant ssh followed by serve responsible.dev /home/vagrant/Code/responsible
but nothing seems to be working.
The output of vagrant up / vagrant provision shows it creating the wordpress.dev site, but not provision.dev
but I'm not sure what I am doing wrong for it to be skipping over.
My 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: ~/Projects
to: /home/vagrant/Code
sites:
- map: wordpress.dev
to: /home/vagrant/Code/wordpress
- map: responsible.dev
to: /home/vagrant/Code/responsible
databases:
- homestead
and hosts file:
192.168.10.10 wordpress.dev
192.168.10.10 responsible.dev
I assume it is something basic and obvious that I am over-looking, but I can't for the life of me see it.
Thanks in advance!

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.

Homestead setup does not work

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]

No laravel sync folders in homestead vagrant on windows

i installed vagrant lately on my windows 7 machine, i successfully runned the virtual machine because i can ssh to it but no synchronization between my local project and the homestead.
my yaml file is like :
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/User/Homestead/projects
to: /home/vagrant/sites
sites:
- map: laravel.dev
to: /home/vagrant/sites/laravel/public
hhvm: true
databases:
- homestead
variables:
- key: APP_ENV
value: local
My laravel project is inside projects folder in my local homestead directory, but it seems that the sites folder that links to it is not synced with it !!
i'm not good at unix command line but is it weird that ls -la command work but ls alone don't seem to work as i saw if tutorials ?
update :
After changing the hosts file setup for : 127.0.0.1 laravel.dev to 192.168.10.10 laravel.dev the site was accessible in my browser, but the problem of no syncronization still happening (i had to install a new laravel in vangrant) i want to deplay my project from wamp to projects folder and be syncronized with "sites" in homestead
Edit your Homestead.yaml
In the line
---
folders:
- map: E:/projects //your projects folder here
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
Now if you are using Windows, open notepad as administrator and your hosts
System32/drivers/etc/hosts
192.168.10.10 laravel5angularapp.dev
192.168.10.10 angular2laravel.dev
192.168.10.10 laravel5-angular2.dev
192.168.10.10 yourproject.dev
Now access your homestead
homestead up
homestead ssh
Inside homestead
cd Code
ls -a
All your projects should appear here, then
cd ~
then
serve yourproject.dev /home/vagrant/Code/yourlaravelprojectname/public/
Then
sudo service nginx restart
Or
homestead reload
Your project should be running in
http://yourproject.dev
I've tried many things but none of them worked. Finally i've changed map folder to the full path version and then run the vagrant reload command and it was ok.
Homestead.yaml
folders:
- map: C:/Users/username/Code
to: /home/vagrant/Code.
vagrant reload
You can use ~/Homestead/projects in windows is the same the C:\Users\your_user\your_folders

Resources