Build the LNMP development environment with vagrant under windows

Source: Internet
Author: User

1. Installing Vagrant,vitrualbox

2. Download the Homestead box package and add it to the vagrant

Https://atlas.hashicorp.com/laravel/boxes/homestead

If you do not see the download link, the version number can be stitched to the following address to download, will be the following 0.2.6 to download the corresponding version.

Https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.6/providers/virtualbox.box

To add a package to vagrant:

Vagrant Box Add Laravel/homestead/path/to/virtualbox.box

You can then switch to the project directory to generate the configuration file:

CD ~/project
Vagrant Init Laravel/homestead

A configuration file Vagrantfile is generated under the project directory.

But I'm not going to build the configuration file myself and then go to the cumbersome configuration.

Download the Homestead configuration file and then simply modify it on this profile.

3. Download the homestea corresponding configuration file with a simple configuration.

Https://github.com/laravel/homestead

Put the download file in the homestead, you will see there is also a file called Vagrantfile configuration file.

To switch to Homestead, initialize the configuration file:

Bash init.sh

The directory ~/.homestead/will be generated, and entering this directory will see a Homestead.yaml file that is configured here.

Content of Homestead.yaml:

---IP: "192.168.10.10"//virtual machine IP address  memory:2048//Memory 2gcpus:1provider:virtualboxauthorize: ~/.ssh/id_rsa.pubkeys:    -~/.ssh/id_rsafolders:    -map:d:\project//native project directory to      :/home/vagrant/code//virtual machine corresponding project directory Sites:    -map: Site1.app  //virtual machine configuration Don't forget to add mappings to native hosts files such as 192.168.10.01 Site1.app to      :/home/vagrant/code/talkmed/ Publicdatabases:    -Homestead//Database name default database account/password  homestead/secret# blackfire:#     -id:foo#       token:bar#       client-id:foo#       client-token:bar# ports:#     -send:50000#       to:5000#     -send:7777# to       : 777#       PROTOCOL:UDP

4. Start-Up and management

The preparation is ready, how to open it?

To switch to the Homestead folder:

Vagrant Up # Start virtual machine Vagrant Halt # Turn off virtual machine vagrant Reload # Restart virtual machine vagrant SSH # SSH to virtual machine vagrant Status # View virtual machine run status Vagrant D Estroy # destroys the current virtual machine vagrant provision #添加了一个sites execution takes effect

stop!

There are questions to leave a message.

Build the LNMP development environment with vagrant under windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.