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!
Related
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.
I just set up a homestead on my Windows 10 machine. Everything looks fine but page is not loading. I am getting connection refused on my browser.
I have asked this on Laracasts with details
https://laracasts.com/discuss/channels/servers/ping-to-homestead-is-fine-but-connection-refused#reply=495171
I think it is a minor issue but don't know where and what to look for.
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: d:/DATA/SourceCodes/laravel
to: /home/vagrant/code
sites:
- map: myapp.test
to: /home/vagrant/code/myapp/public
databases:
- homestead
at many times I found that modern browsers refuses to connect to urls that is ending with some unknown extensions for security reasons, so maybe its the url.
add "myapp.test" to Homestead.yaml file > sites: -map: myapp.test.
make sure you did edit hosts added line192.168.10.10 myapp.test
another possibilities:
if you are using antivirus or any internet security program on your
host system: disable it for a while and test.
if you use proxy for your internet connection, add myapp.test as an exception or disable the proxy for a while
Seems to be a problem with nginx. Try to login to homestead with ssh and check if nginx is running. I had the same problem after upgrading Homestead when my nginx config file was throwing an error (check your config with nginx -t)
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 am now ready to start a new project with Laravel using Vagrant. My initial project worked fine but I can't seem to get the new project to show in the browser with its unique name loginauth.app.
My very first app was called PaulsApp and if I typed paulsapp.app in the browser the laravel started page showed fine.
I followed the instructions to create a new project using composer create project in my VM in the same directory as my first app. I can see this in both the local and on the VM.
Next I updated the homestead.yaml file to include the new sitemap and run vagrant provision to let the VM know of the updates.
I believe I must be overlooking something as my .yaml file has the map as homestead.app but that does not work only paulsapp.app which is in my etc/hosts file.
Please could somebody explain how the .yaml file and the hosts file are interacting. If I completely remove the mapping to PaulsApp in the yaml file, paulsapp.app in the browser still shows up the correct page.. as such I am a tad confused. I thought one simply added a mapping to the yaml and then could access that mapping through the browser. I want to type loginauth.app in the browser and have it point to the index file in the public directory of /home/vagrant/code/loginauth/ thanks.
homestead.yaml
---
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/PaulsApp/public
- map: loginauth.app
to: /home/vagrant/code/loginauth/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
etc/hosts
##
# 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 Paulsapp.app
#127.0.0.1 PaulsApp.dev
OK so thanks to some help from the guys over at #laravel irc channel..
I needed to add the correct line to the hosts file. I tried 192.168.10.10 loginauth.app but got no joy so I used 127.0.0.1 loginauth.app.
Then the key was to vagrant halt the VM, Vagrant UP it again then vagrant provision it so the VM could see the changes.
Now loginauth.app:8000/ brings up the page I was hoping for...
I'm having problem to understand how to run my website using vagrant and Laravel Homestead environment.
I added laravel/homestead box without any problems. Then I ran vagrant init laravel/homestead and it worked too.
I managed to create Homestead.yaml and here's what it contains:
---
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: project.dev
to: /home/vagrant/code/project
databases:
- homestead
variables:
- key: APP_ENV
value: local
vagrant up runs correctly, but I don't know how to access my website. I added 192.168.10.10 project.dev to my /etc/hosts.
I want to keep my project at ~/www/project. First thing that I didn't understand from the docs is, what is the folder at sites / map / to setting supposed to be? My local folder or a folder in the virtual environment?
The next thing I don't understand is why when I do vagrant ssh and then ls, I don't see any files, even though there's index.php at my ~/www/project. I thought they are going to be synchronized automatically.
When I go to project.dev in the browser, it timeouts. I tried project.dev:8000 as well and 192.168.10.10, but nothing works.
Please help me.
You are forgetting the folders parameter, also your indentation should be with spaces and not with tabs, thats the way yaml works, everything else seems to be fine but try to make it with something similar to this one
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/www/project
to: /home/vagrant/code
sites:
- map: project.dev
to: /home/vagrant/code/project/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
you're missing the folder share settings in you're homestead.yaml file.
Try adding
folders:
- map: ~/www/project
to: /home/vagrant/code
Look at the docs here
http://laravel.com/docs/5.1/homestead#configuring-homestead under Configuring Shared Folders
I think this is the common issue that someone new to Laravel Homestead is facing.
Laravel Homestead basically provides an image that gets a VM ready for Laravel development. The yaml config on "sites" is basically use to configure Nginx - it does not install a Laravel project on the path specified.
So for a new homestead VM, you just have to ssh into your Homestead VM, and type and run this:
composer global require "laravel/installer=~1.1"
Once done, on you /home/vagrant/code folder (in the VM, not your host), type and run this:
laravel new project
Where the "project" is the name given to your new project. Since your yaml is already configured to "project", the above command will work fine. Obviously, this is clearly not the only way to get Laravel as you can use composer create-project to install Laravel directly.
Once done, you should be able to visit http://project.dev on your host's browser, if your host file is configured with this added entry:
192.168.10.10<tab>project.dev
Alternatively, you can configure your host file to be
127.0.0.1<tab>project.dev
Which you can then view on your host's browser via http://project.dev:8000
Hope the above explains clear enough. Enjoy!