How do I include variables in my VagrantFile?

I use the approach of https://puphpet.com, I create a file config.yaml in the same directory of the Vagrantfile and… In my Vagrantfile: # encoding: utf-8 # -*- mode: ruby -*- # vi: set ft=ruby : require ‘yaml’ current_dir = File.dirname(File.expand_path(__FILE__)) configs = YAML.load_file(“#{current_dir}/config.yaml”) vagrant_config = configs[‘configs’][configs[‘configs’][‘use’]] Vagrant.configure(‘2’) do |config| config.vm.network ‘public_network’, ip: vagrant_config[‘public_ip’] … In … Read more

I got warning setlocale LC_CTYPE when I ssh connect to vagrant centos 6

For CentOS or Amazon AMI Linux, add these lines to /etc/environment (create it, if it doesn’t exist): LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 To edit this file via SSH console, try sudo nano /etc/environment Edit For Debian-related distributions (Ubuntu, etc.), you should check that /etc/default/locale is empty. That’s the outcome of choosing None in dpkg-reconfigure locales which is suggested … Read more

`ssh` executable not found in any directories in the %PATH%

Adding C:\Program Files\Git\usr\bin to the PATH environment variable. Add it manually or I believe you could run this in cmd: set PATH=%PATH%;C:\Program Files\Git\usr\bin updated from @Ygor Thomaz’s comments or (64 bits) set PATH=%PATH%;C:\Program Files\Git\usr\bin If this doesn’t fix your problem, go through : Get SSH working on Vagrant/Windows/Git

Connection Reset when port forwarding with Vagrant

I had Django listening on 127.0.0.1:8000 (default) As explained in Mitchell’s answer here: Vagrant’s port forwarding not working I should have been listening on 0.0.0.0. Here is a quote of his answer: I wanted to add an additional note that often this is caused by the server within the VM because it binds to 127.0.0.1, … Read more

How do I use vagrant and browsersync with local domain?

Here’s how I got it working. I added port forwarding to vagrant and then I launch browser-sync from within the vm. Everything works now at http://example.dev:3000 and http://example.dev:3001. Here’s what I added to my Vagrantfile: config.vm.network :forwarded_port, guest: 3000, host: 3000, auto_correct: true config.vm.network :forwarded_port, guest: 3001, host: 3001, auto_correct: true

nginx: configuration file /etc/nginx/nginx.conf test failed (host not found in upstream)

All you need is to put resolver that can resolve such domain name: resolver 8.8.8.8 valid=300s; resolver_timeout 10s; Google DNS (8.8.8.8) can resolve it, but it resolves to internal address belongs to network class C. $ dig @8.8.8.8 www.class.com.192.168.33.10.xip.io ;; ANSWER SECTION: www.class.com.192.168.33.10.xip.io. 299 IN A 192.168.33.10

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)