Vagrant with puppet, --manifestdir provision error - php

I wanted to start a small project to learn Vagrat and puppet so I created a DEbian VM with Vagrant.
The VM itself works fine the problem comes when I try to provision it with Puppet.
This is the error I get:
==> default: Running provisioner: puppet...
==> default: Running Puppet with default.pp...
==> default: stdin: is not a tty
==> default: Error: Could not parse application options: invalid option:--manifestdir
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
This is my directory tree:
Vagrantfile
manifests
default.pp
Here is my Vagrantfile:
Vagrant.configure(2) do |config|
config.vm.box = "puphpet/debian75-x64"
config.vm.network "forwarded_port", guest: 80, host: 4527
config.vm.provision :shell, :inline => "apt-get update --fix-missing"
config.vm.provision "puppet" do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "default.pp"
end
end
And here is my puppet manifest:
exec { 'apt-update':
command => '/usr/bin/apt-get update'
}
package { 'nginx':
require => Exec['apt-update'],
ensure => installed,
}
package { 'php5':
require => Exec['apt-update'],
ensure => installed,
}
package { 'redis-server':
require => Exec['apt-update'],
ensure => installed,
}
Im on a Ubuntu 15.10, VirtualBox 5.0.14 and Vagrant 1.7.4

The latest version of your box supports puppet 4.x and the manifest_dir is getting deprecated in puppet 4.x
you can read also from vagrant doc
If only environment and environments_path are specified, it will parse
and use the manifest specified in the environment.conf file. If
manifests_path and manifest_file is specified along with the
environment options, the manifest from the environment will be
overridden by the specified manifest_file. If manifests_path and
manifest_file are specified without environments, the old
non-environment mode will be used (which will fail on Puppet 4+).
so you would need to:
Upgrade your puppet structure for support of puppet 4.x (migrate to directory environment)
or Downgrade the version of your box so puppet 3.x is installed

Related

laravel Homestead starting with error and no input file

I was trying to update my MacBook to the newest version.
Also downloaded and installed the newest version of homestead, virtualbox and vagrant.
I also destroyed my old virtual machines and wanted to start fresh.
I had a couple of problems to get all of them to run again. But now, i got the machine running (vagrant up). At the end i get this error, but dont know what exactly i have to do:
homestead-7: Updating to version 1.8.3 (stable channel).
homestead-7:
homestead-7:
homestead-7: [ErrorException]
homestead-7: rename(/home/vagrant/.composer/cache/composer-temp.phar,/usr/local/bin/composer): Permission denied
homestead-7:
homestead-7:
homestead-7: self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]
The SSH command responded with a non-zero exit status. Vagrant
assumes that this means the command failed. The output for this command
should be in the log above. Please read the output to determine what
went wrong.
Also, i configured my paths in homestead.yaml like this:
---
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: testen.app
to: /home/vagrant/Code/testen/public
also configured it in the hosts. But when i open the link in my browser, it just says "No input file specified."
I log via vagrant ssh to the machine and check the path. It is there.
maybe getting no input file because of the previous error? I really don't know what i have to repair...
Are you sure that the composer.phar file is present? Check your access rights?

Upgrading PHP to 5.5.9

There is an open-source project I want to install on my server, Grav, but it requires PHP 5.5.9. I currently have PHP 5.4.16 installed on a CentOS 7 server running on NGINX. Actually, it is PHP-FPM. So my question is what is the easiest and cleanest way to achieve this?
I have read many articles online regarding this and each one seems to have a different approach such as uninstalling the current version of PHP and reinstalling from scratch.
In order to get a more modern version of PHP you need to use an alternative repo. There are a few out there to choose from, that have traditionally packaged up a newer version of LAMP stack components, like Remi, but for the Centos7 vagrant I'm currently using, I went with webtatic.
You should simply follow the instructions for setting up the alternative repo with yum. Currently that involves:
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Once installed do a yum search php and you'll find php versions 5.5, 5.6, 7.0 and 7.1 to choose from.
Instead of yum install php you're going to do something like yum install php56w.
For example on my VM, this is what I have for php:
[vagrant#localhost:~]$ rpm -qa | grep php
php56w-5.6.31-1.w7.x86_64
php56w-process-5.6.31-1.w7.x86_64
php56w-opcache-5.6.31-1.w7.x86_64
php56w-xml-5.6.31-1.w7.x86_64
php56w-pear-1.10.4-1.w7.noarch
php56w-common-5.6.31-1.w7.x86_64
php56w-cli-5.6.31-1.w7.x86_64
php56w-mbstring-5.6.31-1.w7.x86_64
php56w-pdo-5.6.31-1.w7.x86_64
php56w-mysqlnd-5.6.31-1.w7.x86_64
php56w-fpm-5.6.31-1.w7.x86_64
php56w-gd-5.6.31-1.w7.x86_64
You will need to uninstall your current php version, so this is an involved operation, and you want to have done a dry run, and be confident that you know what you're doing.
As for confidence that something won't break, with Vagrant/Virtualbox/Docker etc., there is no excuse for not testing this out in a VM first.
Not to mention that these are foundation tech for state of the art development these days.
Here's a quick and simple Vagrantfile for a vanilla Centos7 box you can have up and running (assuming you get Vagrant installed and working).
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "centos/7"
# Disable automatic box update checking. If you disable this, then
# boxes will only be checked for updates when the user runs
# `vagrant box outdated`. This is not recommended.
# config.vm.box_check_update = false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
# config.vm.network "forwarded_port", guest: 8080, host: 8080
# config.vm.network "forwarded_port", guest: 80, host: 80
# config.vm.network "forwarded_port", guest: 3306, host: 3306
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.20.20"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder "./data", "/vagrant_data"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# vb.gui = true
#
# # Customize the amount of memory on the VM:
# vb.memory = "1024"
# end
#
# View the documentation for the provider you are using for more
# information on available options.
# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
# such as FTP and Heroku are also available. See the documentation at
# https://docs.vagrantup.com/v2/push/atlas.html for more information.
# config.push.define "atlas" do |push|
# push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
# end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
# config.vm.provision "shell", inline: <<-SHELL
# apt-get update
# apt-get install -y apache2
# SHELL
end

Vagrant up error, changing ownership of /vagrant: not a directory

I'm running Windows 8.1 64-bit on a laptop.
I've been following this guide to try an setup a homestead for my Laravel projects: laravel installation and setup
guide tldr: You just install vagrant, virtual-box and composer. You use these to acquire homestead, then initialize and install. You configure your homestead.yaml and generate ssh keys. After all this you use vagrant up, to have vagrant setup your Vritual machine with your development enviroment and all that stuff.
Using git bash, I follow the guide and get to the 'vagrant up' part.
Here is where it gets hairy, I get the following error:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: homestead
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 80 => 8000 (adapter 1)
default: 443 => 44300 (adapter 1)
default: 3306 => 33060 (adapter 1)
default: 5432 => 54320 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: The guest additions on this VM do not match the installed version o
f
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you
see
default: shared folder errors, please make sure the guest additions within t
he
default: virtual machine match the version of VirtualBox you have installed
on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.14
default: VirtualBox Version: 5.0
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => C:/Users/Work/Homestead/Homestead
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
chown `id -u vagrant`:`id -g vagrant` /vagrant
Stdout from the command:
Stderr from the command:
chown: changing ownership of ���/vagrant���: Not a directory
I have run git bash as admin.
my .yaml file looks like this
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
authorize: C:/Users/Work/.ssh/id_rsa.pub
keys:
- C:/Users/Work/.ssh/id_rsa
folders:
- map: C:/Users/Work/Projects
to: /home/vagrant/Code
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
I got the newest version of Vagrant and Virtual Box.
It seems to me like the error comes from the path to the folder being invalid, but seeing as my yaml file should be correct I don't understand how to solve it.
I did successfully install homestead environment on another windows 8.1 stationary PC but I never encountered this error.
Mitchell confirmed for us that this was a bug in the latest version, it's fixed by now: look at this issue and the relevant commit https://github.com/mitchellh/vagrant/issues/5933
I've just made it through.
So you have Vagrant and the latest VirtualBox.
Restart your computer now if you didn't do it after any of the installations
Uninstall Vbox 5.0
Restart the computer again
Download and install 4.3.30 for amd/x86
Run vagrant up and there you are
So, here is how I actually managed to fix it.
The newest versions of Vagrant (1.3.5) and VirtualBox (4.3.4) do not play together at all on Windows. So, I kept Vagrant 1.3.5 and went down to VirtualBox 4.2.2.
Once you have that, you have to get rid of a couple folders so that everything resets itself correctly:
Users\<<USERNAME>>\.VirtualBox
Users\<<USERNAME>>\.vagrant.d
Delete those before trying to run
vagrant up
With that, I was able to get everything running again. However, I have noticed that running vagrant up does go a tad slower than it had been previously. I can live with that though.
Thank you for all of your help and suggestions.
Currently Vagrant (<=1.7.3) has a bug with VirtualBox 5.0. According to
https://github.com/mitchellh/vagrant/issues/5933
Vagrant 1.7.4 will have a fix for VB 5.0. It can be applied in-tree though, as I mention on the Github issue.
If you get this message then, try to match VirtualBox version on host machine, that will solve the problem.
default: The guest additions on this VM do not match the installed version of
default: VirtualBox! In most cases this is fine, but in rare cases it can
default: prevent things such as shared folders from working properly. If you see
default: shared folder errors, please make sure the guest additions within the
default: virtual machine match the version of VirtualBox you have installed on
default: your host and reload your VM.
default:
default: Guest Additions Version: 4.3.10
default: VirtualBox Version: 5.0
not 100% sure but what it seems like, vagrant is trying to map it's default "/vagrant" folder to your local C:/Users/Work/Homestead/Homestead. If the local does not exist or has some permission errors, /vagrant will not be created and the next command on it will fail. Have a look if C:/Users/Work/Homestead/Homestead is created. And also I do not see this mapping in your yaml. /vagrant => C:/Users/Work/Homestead/Homestead. Is your config not being overwritten with something?

Laravel homestead IP address not working

I’m using Laravel Homestead 2.0 for my VM and am trying to serve my sites on the default IP address in the YAML file 192.168.10.10
My /etc/hosts file looks like this:
# Homestead
192.168.10.10 beta.dev
192.168.10.10 deploy.dev
My Homestead.yaml file looks like this:
---
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: beta.dev
to: /home/vagrant/Projects/emorybeta/public
- map: deploy.dev
to: /home/vagrant/Projects/deploy/public
...
The sites come up when I link my domains to 127.0.0.1 but I have to append port 8000 onto the end of the URL (which isn’t a big deal, I just want to get the specified IP address to work).
Does anyone know why I cannot connect to server when my domains are pointed to 192.168.10.10?
UPDATE:
When I ping deploy.dev the right IP address shows up, but still my browser can’t connect to the server. I’m thinking it might have something to do with DNS issues in Yosemite.
I had the same problems a few weeks ago.
First:
make sure your folder paths are correct, if so, double check it
Next:
run homestead destroy and homestead up to reinitialize the VM
if that all didnt work:
Check if you have any devices at home that might also be on 192.168.10.10.
If that all didnt work, your problem is probably alot harder to fix and i'd suggest making a github issue for it.
Hey I had this exact same problem. I eventually got it working by installing the deprecated net-tools package:
sudo apt-get update and
sudo apt-get install gnome-nettool
After this,
homestead destroy and
homestead up
This allowed me to access my virtual machine sites from my local machine's browser using the 'domains' I specified in the hosts file - in your case beta.dev and deploy.dev - without referring to localhost or port 8000. Good luck, hope this helps.
This is the solution I did for my Windows 10 machine:
Make sure you add a persistent route to your vagrant box
In Administrator command prompt enter
route -p add 192.168.10.0 mask 255.255.255.0 192.168.10.1
And make sure you are able to ping 192.168.10.10
Also check the IP address configured for the virtualbox host-only adapter is 192.168.10.1 with mask 255.255.255.0
I had a similar issue yesterday for Homestead 5. It turned out the cause of my problem was that I was running the wrong Vagrantfile.
An instance should give a response to the ip address: 192.168.10.10
To correct the problem in my case what I did was to follow these instructions: http://laravel.com/docs/5.0/homestead
To recap:
In terminal run:
vagrant box add laravel/homestead
then
git clone https://github.com/laravel/homestead.git Homestead
then
cd ./Homestead
and run this command FROM INSIDE the new "Homestead" folder
bash init.sh
then run the commands vagrant up and vagrant provision to that Vagrantfile, that should have been created inside ./Homestead
Here is what the output of the vagrant provision command looks like on my system:
vagrant provision
==> default: Running provisioner: file...
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-17xwlzk.sh
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-rncs6l.sh
==> default: nginx stop/waiting
==> default: nginx start/running, process 1751
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 1766
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-e9qxwn.sh
==> default: Warning: Using a password on the command line interface can be insecure.
==> default: Warning: Using a password on the command line interface can be insecure.
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-14rlz2c.sh
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-16ethaq.sh
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: inline script
==> default: Running provisioner: shell...
default: Running: inline script
==> default: php5-fpm stop/waiting
==> default: php5-fpm start/running, process 1861
==> default: Running provisioner: shell...
default: Running: inline script
==> default: You are already using composer version 92faf1c7a83a73794fb914a990be435e1df373ca.
==> default: Running provisioner: shell...
default: Running: /var/folders/q6/pgygb1ln4rg7_nvv0p8n1v300000gn/T/vagrant-shell20150714-94163-btuuhg.sh
Installing net-tools on ubuntu fixed this for me
$ sudo install net-tools
$ vagrant destroy
$ vagrant up
I had exactly this issue, and it turned out that nginx was failing to start due to an error when loading the TLS certificates. The vagrant up command doesn't report that nginx failed to start, or that any ports failed to bind.
To diagnose this, I did the following:
$ nmap homestead.app
Starting Nmap 7.01 ( https://nmap.org ) at 2017-10-03 16:16 NZDT
Nmap scan report for homestead.app (192.168.10.10)
Host is up (0.00077s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
1025/tcp open NFS-or-IIS
3306/tcp open mysql
5432/tcp open postgresql
There is no port 80 in the list. Let's double-check port 80.
$ nmap homestead.app -p 80
...
Host is up (0.00020s latency).
PORT STATE SERVICE
80/tcp closed http
So it is certainly closed. What do the guest logs say? vagrant ssh and...
$ systemctl status nginx.service
...
Active: failed (Result: exit-code) since Tue 2017-10-03 03:06:12 UTC; 1min 30s ago
...
homestead systemd[1]: Starting A high performance web server and a reverse proxy server...
homestead nginx[1250]: nginx: [emerg] PEM_read_bio_X509_AUX("/etc/nginx/ssl/homestead.app.crt") failed (SSL: error:0906D06C:PEM routines:PEM_read_bio:no start line:Expecting: TRUSTED CERTIFICA
homestead nginx[1250]: nginx: configuration file /etc/nginx/nginx.conf test failed
homestead systemd[1]: nginx.service: Control process exited, code=exited status=1
homestead systemd[1]: Failed to start A high performance web server and a reverse proxy server.
homestead systemd[1]: nginx.service: Unit entered failed state.
homestead systemd[1]: nginx.service: Failed with result 'exit-code'.
Nginx has failed to start due to an error in it's config. The PEM_read_bio_X509_AUX error points to the /etc/nginx/ssl/homestead.app.crt file. Where is that file used in the configuration?
$ sudo vim /etc/nginx/sites-enabled/homestead.app
I commented out the related lines:
## -1,6 +1,6 ##
server {
listen 80;
- listen 443 ssl http2;
+# listen 443 ssl http2;
server_name homestead.app;
root "/home/vagrant/Code/public";
## -42,7 +42,7 ## server {
deny all;
}
- ssl_certificate /etc/nginx/ssl/homestead.app.crt;
- ssl_certificate_key /etc/nginx/ssl/homestead.app.key;
+# ssl_certificate /etc/nginx/ssl/homestead.app.crt;
+# ssl_certificate_key /etc/nginx/ssl/homestead.app.key;
}
Start nginx with $ sudo service start nginx and run nmap again from the host.
$ nmap homestead.app -p 80,443
...
PORT STATE SERVICE
80/tcp open http
443/tcp closed https
Port 80 is open and should be accessible now from http://homestead.app . Of course TLS won't be working but you should be able to fix it by generating new certificates. I'm not sure of the reason for the certificates failing to load in the first place.
I had the same situation, but I made a change.
I changed my /etc/hosts file with this IP 127.0.0.1
In my case the problem was solved by letting vagrant up install the guest additions:
~/Homestead (master|✔) $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
[...]
GuestAdditions versions on your host (5.0.26) and guest (5.0.20) do not match.
[...]
Copy iso file /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso
mount: /dev/loop0 is write-protected, mounting read-only
Installing Virtualbox Guest Additions 5.0.26 - guest version is 5.0.20
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.0.26 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 5.0.20 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used
After this point, I got a new interface with the expected IP address:
enp0s8 Link encap:Ethernet HWaddr 08:00:27:e8:04:04
inet addr:192.168.8.10 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fee8:404/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:996 (996.0 B)
I had this issue come up on my Windows machine and it turns out I had accidentally reversed the folders section "map" and "to". When I found that the folder wasn't underneath ~/code/ in the vagrant ssh session it was obvious it wasn't working right, but double checking the paths didn't yield anything.
Here is the correct way to map the folder section on your Windows machine:
folders:
- map: D:/Development/PHP/projects/
to: /home/vagrant/code
The only reason is need to put hostname and IP in host file
C:\Windows\System32\drivers\etc
Open Notepad as a Admin
click open file and select "host" file
put your domain (eg 192.168.10.10 homestead.app)
save (make sure you are saving as Admin)
Done!
Use this Vagrant plugin
vagrant plugin install vagrant-hostmanager
then run this in your homestead folder to provision again
vagrant reload --provision
Then you do no need to update the host file every time you add a new project!

Add php and nginx settings to homestead 2.0 provisioning

i would like to increase the default max-post size in the php.ini and max upload size in the nginx config. How can i add that in an .sh file so it get executed when i provision the box?
Use the provision tools, such as puppet, chef, salt, ansible, etc.
For example, put below lines in your Vagrantfile, it will automatically apply puppet modules (such as php and nginx) with your changes.
config.vm.provision :puppet do |puppet|
puppet.module_path = "modules"
puppet.manifests_path = "manifests"
puppet.manifest_file = "vagrant.pp"
puppet.options = ['--verbose']
end
Take a look on these urls.
https://docs.vagrantup.com/v2/provisioning/puppet_apply.html
https://docs.vagrantup.com/v2/provisioning/ansible.html
https://docs.vagrantup.com/v2/provisioning/chef_solo.html
The correct answer to the exact question would be (given the current version of Homestead):
After cloning go to src/stubs and edit the after.sh file
launch init.sh from the root of the repository
vagrant up
after.sh is a file copied to the VM and launched after homestead finishes its provisioning.

Categories