Skip to main content

VirtualBox

Deprecated

on M1 mac, VirtualBox won't work, so please implement local environment by Docker.

Install Applications

You need installing following applications.

How to install

VirtualBox

  1. Access to website, and click download button.
  2. Click "OS X hosts" link

Vagrant

  1. Access to website, and click download button.
  2. Click macOS > "64-bit" link

Homebrew and Git

Please check Git page.

Ansible

After installing Homebrew.

brew install ansible

Check the installation

# Vagrant
vagrant -v
> Vagrant *.*.*

# Git
git --version
> git version *.*.*

# Ansible
ansible --version
> ansible *.*.*

Set up Local environment

There are ansible template of local environment on GitHub.

Initial setting up

Open Terminal, and run following commands.

# Creating Developing Directory
mkdir ~/Virtual

# Anywhere is OK, move to your favorite place
# For example, into your user directory
cd ~/

# Getting datas from GitHub
git clone https://github.com/sushat4692/VagrantAnsible.git

# Move to downloaded directory
cd VagrantAnsible

# Running Vagrant command
vagrant up --provision

After that

After you setting up, you can use local environment and it's related localhost to ~/Virtual.

http://foo.localhost/ -> ~/Virtual/foo/htdocs
http://bar.localhost/ -> ~/Virtual/bar/htdocs