Using Vagrant under Ubuntu to create a cross-platform portable LAMP development environment

Vagrant actually put it plainly. It is a tool for managing virtual machines. Anyway, there are many benefits. You can check the others yourself.

required tools

1, vagrant, this is necessary, used to manage virtual machines
  • Download the corresponding version for your computer
  • Download address: https://releases.hashicorp.com/vagrant/1.8.6
2. Virtual machine software, here I use VirtualBox   
  • Download address: https://www.virtualbox.org/wiki/Download_Old_Builds_5_1 
3. A box image, this .box file is equivalent to your system image file
  • Download address: I will not provide it here, if you need it, go to a certain degree to download it

Install the virtual machine

  • Add box: vagrant box add box name box file path
  • View box: vagrant box list
  • Initialize the box to generate the configuration file: vagrant init Fill in the name of the box you just added here

Install php+MySQL+apache

The environment is installed in " Ubuntu install lamp development environment and composer and laravel "

Package and distribute

If you want to give your configured environment to others, you need to use packaging. The so-called packaging is actually packaging your virtual machine into a .box image file. What is the benefit of this? For example, if you have already After the development environment is installed, the next time someone uses the image file you packaged to start the virtual machine, there is no need to install the environment. This is equivalent to the predecessors planting trees, and future generations enjoying the shade.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325512065&siteId=291194637