Can't connect to website on port 80 with Laravel Homestead - laravel

I'm using Laravel Homestead for my development environment. I have it working at 192.168.0.141:8000, but I need it to work directly at just 192.168.0.141 (i.e. port 80). But it's just not working and I'm not sure what I'm doing wrong. I had it working months ago, but it's not working anymore.
Here's my Homestead.yaml:
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
ssl: true
folders:
- map: C:\Users\John\Documents\Github\my-app
to: /home/vagrant/my-app
sites:
- map: homestead.test
to: /home/vagrant/my-app/public
networks:
- type: "public_network"
ip: "192.168.0.141"
databases:
- homestead
features:
- mysql: false
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: false
Thank you

Related

Unable to connect to database using homestead

I'm using homestead globally and I'm getting this error when I'm trying to add my database details to datagrip
The specified database user/password combination is rejected: [28000] FATAL: no pg_hba.conf entry for host "192.168.10.1", user "homestead", database "dogs", SSL on
this is my Homestead.yaml file
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/projects/code
to: /home/vagrant/code
sites:
- map: site1.test
to: /home/vagrant/code/site1/public
- map: site2.test
to: /home/vagrant/code/site2/public
- map: site3.test
to: /home/vagrant/code/site3/public
php: "7.4"
- map: dogs.test
to: /home/vagrant/code/dogs/public
php: "7.4"
databases:
- site1
- site2
- site3
- dogs
features:
- mysql: true
- mariadb: false
- postgresql: true
- ohmyzsh: false
- webdriver: false
#services:
# - enabled:
# - "postgresql#12-main"
# - disabled:
# - "postgresql#11-main"
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
and what I have in my datagrip when I try to connect
Host: 192.168.10.10
Port: 5432
Authentication: User & Password
User: homestead
Password: secret
Database: dogs
Had the same problem once. I was working with grafana local at the time. Some setups which use postgresql cannot work properly localy with the 10.10 adress.
My fix was changing the ip of my vagrant box to 10.11 .
this fixed the issue.
And if you want to revert that for other project's you can easily do:
#ip: "192.168.10.11"
ip: "192.168.10.10"
Not sure if this will be the solution for your problem. But worth a try

Homestead not loading web page

I have searched and tried everywhere for something that might fix this but whenever I have a new homestead code folder, it doesn't work when I use vagrant and virtualbox. I have checked my hosts files and every file. No error shows up but it clearly doesn't work. I have also enabled virtualization on my CPU. Below is my current homestead.yaml file
---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
folders:
- map: C:/Laravel/code
to: /home/vagrant/code
sites:
- map: homestead.test
to: /home/vagrant/code/homestead/public
- map: homestead1.test
to: /home/vagrant/code/homestead1/public
- map: coursework.test
to: /home/vagrant/code/coursework/public
databases:
- homestead
features:
- mariadb: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
I am trying to just get coursework.test to work but I'm sure its wrong on both of them
Your problem is in the way you use your slashes.
- map: C:/Laravel/code
has to be
- map: C:\Laravel\code
Another problem you will be walking against is that you do not have a database.
Enable mariadb or something else in your features tab

Homestead gives error: No input file specified. on Windows 10

I'm running Homestead under Windows 10 using VirtualBox. For some reason, no matter what I try, I get this error:
I only found a single other question similar to my issues, and the resolution there resulted in an error when running vagrant up.
No input file specified.
My homestead.yaml file looked like this:
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
folders:
- map: D:/code
to: /home/code
sites:
- map: homestead.test
to: /home/code/test/public
sites:
- map: info.test
to: /home/code/info/public
sites:
- map: food.test
to: /home/code/food/public
databases:
- homestead
- food
- info
features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: f
My hosts file is:
192.168.10.10 homestead.test
192.168.10.10 info.test
192.168.10.10 food.test
The folder mappings appear to be working. If I browse D:/code from the host I can see the Laravel
install under D:/code/test. I if put a file there on the host, it's visible from vagrant ssh.
What am I missing?
Try updating your Homestead.yaml file to this:
sites:
- map: homestead.test
to: /home/code/test/public
- map: info.test
to: /home/code/info/public
- map: food.test
to: /home/code/food/public
Maybe specifying "sites" multiple times is what's breaking it.
Have you tried logging in to your box with vagrant ssh and then doing flip to toggle between nginx and Apache?
See https://laravel.com/docs/8.x/homestead#web-servers

Laravel Homestead Not Accepting Key Pairs

I have just started trying to set up an instance of homestead. I have been successful so far but I am a bit confused on the current step. I am on a windows machine so have mapped my homestead.yaml ssh key paths to the full windows paths and have confirmed their existence/location. Now when I attempt to ssh into my vagrant box, I am prompted for a password. The default "vagrant" password works but I was under the impression that the ssh keys would handle my sign on.
Here is a look at my homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox //This is my provider
authorize: C:/Users/me/.ssh/id_rsa.pub
keys:
- C:/Users/me/.ssh/id_rsa
folders:
- map: C:/PROGRA~1/Laravel/Homestead/projects/website
to: /home/vagrant/projects/website
sites:
- map: website.test
to: /home/vagrant/code/website/public
databases:
- website
features:
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: false
# ports:
# - send: 50000
# to: 5000
# - send: 7777
# to: 777
# protocol: udp
If you are on a windows machine you need to fix your slashes.
authorize: C:\Users\me\.ssh\id_rsa.pub
keys:
- C:\Users\me\.ssh\id_rsa
folders:
- map: C:\PROGRA~1\Laravel\Homestead\projects\website
to: /home/vagrant/projects/website
and the rest is correct.

Homestead on windows, not accessible trough browser

I'm trying to set up a homestead machine on my Windows8 PC, for Laravel development. I have managed to get the machine up and running, I can SSH into it.
But somehow visiting http://homestead.app doesn't work.
I returns "This web page is not available".
I added this line to my hosts file:
192.168.10.10 homestead.app
My Gitbash did say at a certain piont: "Warning: Connection timeout. Retrying..." But continued anyway.
This is how my Homestead.yaml looks like:
---
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/Laravel/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
You can redirect your request to your host port and with your host machine you would be able to access you app.

Resources