Laravel homestead ignores features to be installed - laravel

I want to add Minio to my Homestead VM. I've added the features option to the homestead.yml file, but running vagrant reload --provision doens't change anything and visiting http://homestead:9600/ gives me a ERR_CONNECTION_REFUSED. What am I missing here?
---
ip: "192.168.10.10"
memory: 4096
cpus: 1
provider: virtualbox
name: ausbildungsportal
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: E:\programierung\ausbildungslink
to: /home/vagrant/code/ausbildungslink
- map: E:\programierung\uptimechecker
to: /home/vagrant/code/uptimechecker
sites:
- map: azubi.tested
to: /home/vagrant/code/uptimechecker/public
- map: help.tested
to: /home/vagrant/code/ausbildungslink/public
databases:
- homestead
- azubiportal
- ausbildungslink
features:
- minio: true

I tried it and it didn't work for me. Fixed it by updating to the latest version of homestead
composer require laravel/homestead

I've just faced the same issue, leaving my solution here just in case.
For each feature, a separate script is triggered to manage the installation.
E.g. for docker it is homestead/scripts/features/docker.sh.
Inside it is checking if the feature is already installed (may look slightly different depending on the version):
if [ -f /home/$WSL_USER_NAME/.homestead-features/docker ]
then
echo "docker already installed."
exit 0
fi
So, if the feature is not installed, but still ignored by the Homestead script, you can just delete the needed file inside the VM (e.g. /home/vagrant/.homestead-features/docker for docker feature, similar for other features).

Related

Homestead mapping folders and sites on ubuntu machine

I'm used to working in a windows environment and have homestead up and running on my windows machine.
I'm now trying to set up homestead on a machine running ubuntu, partly as a development opportunity for me and to overcome some perceived issues in windows that I've experienced with setting up development workflow. anyway....
I've successfully installed homestead and after vagrant upand changing my hosts file I can get the vagrant machine up and running. I can ping the url for my development site. However when I try and view the site in the browser - i get a timeout.
I can SSH into the vagrant machine but navigating to home/vagrantthere is no code folder - so it doesn't appear to be creating that folder on set up.
I added that folder from within the machine as sudo and gave write permissions - On examining the start up script I can see this message:
homestead: /home/vagrant/code => /media/ray/Develop/vagrant/projects
==> homestead: Detected mount owner ID within mount options. (uid: 1000 guestpath: /home/vagrant/code)
==> homestead: Detected mount group ID within mount options. (gid: 1000 guestpath: /home/vagrant/code)
Q1: Is there an error log within homestead I can view to try and work out what the issues are?
Q2: For now I'm assuming it may be a mapping issue in my homestead.yaml file - although in the past on windows this has manifested itself as ǹo input file detected`error.
My code is on a separate partition to the ubuntu machine (on my dual boot laptop). I can navigate to the files which are located in the media folder with this path:
/media/ray/Develop/vagrant/projects
Here is my current homestead.yamlfile:
---
ip: "192.168.56.56"
memory: 2048
cpus: 2
provider: virtualbox
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: /media/ray/Develop/vagrant/projects
to: /home/vagrant/code
sites:
- map: wedleague.loc
to: /home/vagrant/code/wedleague/public
php: "8.1"
databases:
- homestead
- wedleague
- sandpit
features:
- mysql: true
- mariadb: false
- postgresql: false
- ohmyzsh: false
- webdriver: true
services:
- enabled:
- "mysql"
# - disabled:
# - "postgresql#11-main"
ports:
- send: 33060 # MySQL/MariaDB
to: 3306
Have I mapped this correctly? - I'm still getting used to ubuntu file system (mounted/symlink etc) over windows so wonder if I've made an error here.
Thank you

Laravel Homestead and vagrant don't create the folder inside vagrant box

I use Laravel Homestead for one year it all was good before I had decided change php version.
Firstly I update vagrant. Secondly I executed all commands from updating guide
vagrant destroy
git fetch
git pull origin release
vagrant box update
vagrant up
After vagrant up I saw that my databases were not created and my folder was not mounted (http://joxi.ru/Vm66DpgF410M5m).
I tried to connet via vagrant ssh, but there is not folder "code"
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: /home/ubuntu/PhpstormProjects/fntr
to: /home/vagrant/code/fntr
schedule: true
sites:
- map: fntr.test
to: /home/vagrant/code/fntr/public
php: "7.4"
databases:
- homestead
- testing
- imports
- prod_copy
I tried use vagrant destroy && vagrant up. I also tried vagrant reload --provision.
I have found the same issues in google and github, but this advices (http://joxi.ru/52a53oGUEBZMZ2 and other) did not help me.
I have the latest versions of vagrant and homestead.
I think that schedule: true not belongs to folders but to sites, try to remove it and run vagrant reload --provision.
I have found solution. But I am not sure that it is solution exactly.
I just reinstalled laravel homestead. Yes, I deleted homestead folder and went via instalation tutorial again.
Then I pasted my old Homestead.yaml and init vagrant box again.
Note if you want to try this method do not forget copy all of your after.sh, homestead.yaml and other files which can be lost

My Laravel Homestead doesn't work

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!

Laravel Homestead shared folder missing

I've got Vagrant and Virtual Box installed. I'm in the process of trying to get Homestead working. My .yaml file looks like
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: C:/Users/GiggleSquid/.ssh/id_rsa.pub
keys:
- C:/Users/GiggleSquid/.ssh/id_rsa
folders:
- map: D:/Code
to: /home/vagrant/Code
sites:
- map: 8Byte.app
to: /home/vagrant/Code/Projects/8Byte/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
But every time I run vagrant up in Git Bash, it throws an error
GiggleSquid#SQUID-RIG /d/Code/Homestead (master)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:
vm:
* The host path of the shared folder is missing: ~/Code
Any ideas?
Exactly same answer to error log. You Code folder is missing in your Windows environment. Create a folder name Code placed in D:/
You should check VirtualBox version. VirtualBox5.0 version doesn't work shard folder. it is working on VirtualBox 4.3 version.

Laravel Homestead 2.0 Adding New Sites

Homestead 2 is awesome, but I can't seem to get new sites to work without going through the following process.
I do homestead edit to setup the new site paths and domains etc
I edit hosts to set up the domain
I do homestead halt then homestead up to restart
This is when I think things should be working... but they don't. I have to run the additional step of
Running vagrant global-status getting the id and running vagrant provision <id>.
Everything works except running provision again wipes out all the databases! How do I add new sites without having to provision again?
Instead of step 3 use vagrant provision in your homestead directory (~/.composer/vendor/laravel/homestead/).
As I know Taylor is already planning a "provision" flag, until that you can feel free to use vagrant commands.
this works for me
homestead halt && homestead up --provision
Here is my ~/homestead/.Homestead.yaml file, it contains a configuration for two apps, one with HHVM enabled and one with HHVM disabled(default in homestead).
Homestead will create the database for you in MySQL and PostgreSQL server, when running homestead up.
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/Projects
to: /home/vagrant/Projects
sites:
- map: jobs.app
to: /home/vagrant/Projects/jobs/public
- map: messages.app
to: /home/vagrant/Projects/messages/web
hhvm: true
databases:
- jobs
- messages
variables:
- key: APP_ENV
value: local
You can now run:
$ homestead up
and then:
$ homestead ssh
and then run byobu(for tmux):
$ byobu
and cd into the project:
$ cd Projects/jobs
and run composer:
$ composer update

Resources