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