Set up Develop environment with Vagrant

เตรียมเครื่องด้วย vagrant สร้าง project folder ชื่อ mysql และสร้าง file Vagrantfile ดังนี้

    mkdir mysql
    cd mysql
    vim Vagrantfile

vagrantfile

# -*- 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|
  config.vm.box = "centos/7"
  config.vm.network "forwarded_port", guest: 3306, host: 3306
  config.vm.network "private_network", ip: "192.168.30.10"

  config.vm.provider :virtualbox do |vb|
    vb.customize ["modifyvm", :id, "--memory", "1024"]
    vb.customize ["modifyvm", :id, "--cpus", "1"]
    vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
    vb.customize ["modifyvm", :id, "--audio", "none"]
    vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
    vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
  end
end
vagrant plugin install vbguest
vagrant up
vagrant ssh

หากมีความผิดพลาดเนื่องจาก locale

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

ให้ทำการแก้ไข

vi /etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8

results matching ""

    No results matching ""