ModernPUG/php-the-right-way

/_posts/13-02-01-Vagrant.md

Closed this issue · 1 comments


---
isChild: true
anchor:  vagrant

---

## Vagrant {#vagrant_title}

개발환경과 운영환경을 서로 다르게 사용하면 운영환경에 어플리케이션을 배포했을 때 의도하지 않은 이상한 
버그를 만날 가능성이 높습니다. 또 여러 사람이 같이 개발할 때 서로 다른 환경에서 모두 동일한 라이브러리
버전을 최신으로 유지하며 관리하는 일은 성가신 일이 되기도 합니다.

Windows에서 개발하면서 Linux 등의 Windows가 아닌 환경에 배포하여 운영하거나, 팀을 이뤄 개발할 때에는
가상 머신을 사용하는 게 나을 수도 있습니다. 가상 머신을 사용한다는게 복잡하게 들릴 수도 있겠지만, 
[Vagrant][vagrant]를 사용하면 단지 몇 단계만으로 간단한 가상 머신을 구성할 수 있습니다.
이렇게 만든 "기본 가상 머신"에서 출발하여 수작업으로 환경을 설정할 수도 있고, 
[Puppet][puppet]이나 [Chef][chef] 같은 "프로비저닝(provisioning)" 도구로 설정할 수도 있습니다.
프로비저닝 도구를 사용하면 여러개의 기본 가상 머신을 동일한 방식으로 설정할 수 있습니다.
또한 복잡한 "초기 설정" 커맨드 목록을 직접 관리하지 않아도되어 편리합니다. 그리고 기본 가상 머신을
"파괴"하고 "깨끗한" 상태로 새로 만드는 작업도 간단히 할 수 있게 도와줍니다.

Vagrant는 여러분의 호스트 컴퓨터와 가상 머신 사이에 공유 폴더를 만들어줍니다. 그래서 호스트 컴퓨터에서
파일을 수정하고 가상 머신에서 실행하는 식으로 작업할 수 있습니다.

### 도움되는 내용들

Vargrant 사용을 시작하는데 약간의 도움이 필요하신 분은 아래 세 서비스가 유용할 것 같습니다.

- [Rove][rove]: 흔히 사용되는 Vagrant 빌드를 미리 만들어 둘 수 있게 도와주는 서비스입니다. PHP도 고려되어 있습니다. 프로비저닝은 Chef로 하게 되어 있습니다.
- [Puphpet][puphpet]: PHP 개발에 사용할 가상 머신을 설정할 수 있는 단순한 GUI를 제공합니다. **매우 PHP에 특화되어 있습니다**. 로컬 가상 머신외에도 클라우드 서비스에 배포하는데에도 사용할 수 있습니다. 프로비저닝은 Puppet으로 하게 되어 있습니다.
- [Protobox][protobox]: vagrant 를 기반으로 더 상위에 구축된 툴로서 웹 개발을 
위한 가상 머신을 설정할 수 있는 웹 GUI를 제공합니다. YAML 문서 하나로 가상 머신에
설치된 모든 것을 제어할 수 있습니다.

[vagrant]: http://vagrantup.com/
[puppet]: http://www.puppetlabs.com/
[chef]: http://www.opscode.com/
[rove]: http://rove.io/
[puphpet]: https://puphpet.com/
[protobox]: http://getprotobox.com/


[Vagrant] helps you build your virtual boxes on top of the known virtual environments and will configure these
environments based on a single configuration file. These boxes can be set up manually, or you can use "provisioning"
software such as [Puppet] or [Chef] to do this for you. Provisioning the base box is a great way to ensure that
multiple boxes are set up in an identical fashion and removes the need for you to maintain complicated "set up"
command lists. You can also "destroy" your base box and recreate it without many manual steps, making it easy to create
a "fresh" installation.

Vagrant creates folders for sharing your code between your host and your virtual machine, which means that you can
create and edit your files on your host machine and then run the code inside your virtual machine.

### A little help

If you need a little help to start using Vagrant there are some services that might be useful:

- [Rove][Rove]: service that allows you to pre-generate typical Vagrant builds, PHP among the options. The provisioning is
made with Chef.
- [Puphpet][Puphpet]: simple GUI to set up virtual machines for PHP development. **Heavily focused in PHP**. Besides local VMs,
it can be used to deploy to cloud services as well. The provisioning is made with Puppet.
- [Protobox][Protobox]: is a layer on top of vagrant and a web GUI to setup virtual machines for web development. A single YAML
document controls everything that is installed on the virtual machine.
- [Phansible][Phansible]: provides an easy to use interface that helps you generate Ansible Playbooks for PHP based projects.


[Vagrant]: http://vagrantup.com/
[Puppet]: http://www.puppetlabs.com/
[Chef]: http://www.opscode.com/
[Rove]: http://rove.io/
[Puphpet]: https://puphpet.com/
[Protobox]: http://getprotobox.com/
[Phansible]: http://phansible.com/

정리

해결