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.
Related
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.
Im trying to launch my website on my local host but every time i time the domain (Whoodie.dev:8000)into my browser I get "no input file specified" on my screen.
This is my homestead.yaml file I think thats were the problem lay. Can anybody help me or point me in the right direction?
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: Whoodie.dev
to: /home/vagrant/Code/www/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
It sounds like nginx is struggling to find the location that you've told it to load from.
If you vagrant ssh into the box and run cd /home/vagrant/Code/www/Laravel/public does it exist?
If not, assuming your folder structure inside ~/www is actually ~/www/Code/Laravel/public then your mapping should be:
sites: - map: Whoodie.dev to: /home/vagrant/www/Code/Laravel/public
Try changing that then run vagrant provision and see if that helps.
I have mapped one project in the homestead yaml file and runs perfectly
but I tried to figure out how it works if I map more than one site
The domain name that is specified in the file as a second site I want to map is in this case called lkprojects.app
To be more concrete I want to direct to my lkprojects.app homestead domain
but it fails and I have tried with the serve command and homestead provision
So I'm a little confused about how I get that to work using the lkprojects.app domain
My homestead.yaml file looks like:
<code>
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: C:\Users\leo\.ssh\id_rsa.pub
keys:
- /Users/leo/.ssh/id_rsa
folders:
- map: /Projects
to: /home/vagrant/Projects/
sites:
- map: athliit.app
to: /home/vagrant/Projects/athliit/public
- map: lkprojects.app
to: /home/vagrant/Projects/lkprojects/public
databases:
- homestead
- athliit
- lkprojects
variables:
- key: APP_ENV
value: local
</code>
So if anyone knows what I'm doing wrong I would like some input.
Couple things:
Make sure you have added them to your hosts file:
192.168.10.10 athliit.app
192.168.10.10 lkprojects.app
In windows it's located in C:\Windows\System32\drivers\etc\hosts. OSX/Linux in /etc/hosts
Have you ran vagrant provision? This will propagate any config changes to your homestead instance
I think I finally got homestead installed on my laptop! Now, I am trying to view my laravel project in the browser.
When I open "dev.app" in the browser I get a message that say "No input file specified." which I think means that my homestead is working but the laravel project is not there/setup.
I have created a folder called Projects on my local laptop (i.e. ~/Projects). Then from inside of it i executed this command
laravel new dev
But I still get the same error message in the browser i.e. "No input file specified." I have also tried to open this link "dev.app"/dev" but I still get the same message.
What I am doing wrong?
Here is the content of 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: dev.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
Additional, when I execute the following 2 commands in order
cd ~/Projects
ls
I see the following directories dev homestead
What should I do to see my project when I go to dev.app ? Do I need to do anything from my Ubuntu VM or I should be able to edit the files directly in located on ~\Projects\dev" from my laptop?
Add an entry in /etc/hosts on your local machine
192.168.10.10 dev.app
Correct the path to the public folder in the sites section of your Homestead.yaml
sites:
- map: dev.app
to: /home/vagrant/Code/dev/public
I have this strange problem. Let me describe it:
The mapping on the .yaml doesn't work. forum.app will just open up a Google search.
The debug is set to true for local, yet, errors aren't presented in browser. They're logged though.
I am using Homestead 2.0, Laravel 4 (everything is latest) on a Yosemite (updated today). The code is here:
YAML file
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /Users/aligajani/Dropbox/Work/Code
to: /home/vagrant/Code
sites:
- map: forum.app
to: /home/vagrant/Code/CommunityFT/forum/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
HOSTS file
#Added by XAMPP Control
127.0.0.1 Alis-MacBook-Pro.local
192.168.10.10 forum.app
In order to get forum.app to be a valid domain that works with Homestead, you'll need to point it to your local computer in your hosts file.
You can do this by opening up terminal, and typing vim /etc/hosts, then add the line:
127.0.0.1 forum.app
Your browser may fail to look up the forum.app domain too, so remember to try adding a forward slash teh first time you visit it, so forum.app/, this will prevent the browser trying to google it.
Errors not being presented to the browser may be something to do with this pull request:
https://github.com/laravel/homestead/pull/140
Which is an Nginx configuration issue.
Hope this helps!