The first step for any project to use Vagrant is to configure Vagrant using aVagrantfile. The purpose of the Vagrantfile is twofold:
-
Mark the root directory of your project. A lot of the configuration of Vagrant is relative to this root directory.
-
Describe the kind of machine and resources you need to run your project, as well as what software to install and how you want to access it.
Vagrant has a built-in command for initializing a directory for usage with Vagrant:vagrant init. For the purpose of this getting started guide, please follow along in your terminal:
This will place a Vagrantfile in your current directory. You can take a look at the Vagrantfile if you want, it is filled with comments and examples. Don't be afraid if it looks intimidating, we'll modify it soon enough.
You can also run vagrant init in a pre-existing directory to setup Vagrant for an existing project.
The Vagrantfile is meant to be committed to version control with your project, if you use version control. This way, every person working with that project can benefit from Vagrant without any upfront work.
扫码二维码 获取免费视频学习资料
- 本文固定链接: http://phpxs.com/post/1246/
- 转载请注明:转载必须在正文中标注并保留原文链接
- 扫码: 扫上方二维码获取免费视频资料