Windows Homestead Development Environment Installation detailed Tutorial _win server

Source: Internet
Author: User
Tags ssh file permissions git clone

I. Preparation of resources

Link: http://pan.baidu.com/s/1mh7qUBe Password: p4wx

1. virtualbox.box files are placed on the C-packing directory.

2. Metadata.json files are placed on the C disk user directory. Like mine is C:\Users\pc.

3. Git-2.9.3-64-bit.exe download and install, all defaults are good.

4. Vagrant_1.8.5.msi download and install.

5. Virtualbox-5.1.4-110228-win.exe download and install.

Ii. Introduction

  1. What is vagrant?

VirtualBox believes a lot of people have used it, it's a virtualization software that is used to virtual a computer on our computers, and VMware Workstation, KVM, Xen, and so on is a kind of thing (professional point is called hypervisor), but it provides an Easy-to-use interface ( VMware also has the support of the platform (Linux, Win, Mac), but also very lightweight, the most critical free ah, so the use of very wide.

We usually use VirtualBox the most common situation is that the computer is a win, want to run a Linux, or the computer is a Linux, to run win online silver Ah, qq what the win only and so on, although there are wine such things, Can run under the Linux win under the software, but there is a win system stability is not better, and now the computer configuration, there is no need to worry about virtual machine consumption memory CPU what, you do not need that is wasted, not to mention VirtualBox so light. Personal experience, to get an XP virtual machine run QQ resource consumption than the chrome or FF login WEBQQ less, the abominable use of how many JS ...

The daily code of the pain of the programmer, VirtualBox can not be simple to hang a Q so used, programmers do the most is code codes, may do a lot of projects, the company in Java, PHP, go home and play a python or something, Want to experience the new version of the MongoDB or Nginx,emacs or vim configuration, guaranteed which project previous version of the database is MySQL, the next version with PostgreSQL, so many things are all together, installed on a computer, Will certainly be this kind of configuration environment of Dizzy dizzy, annoying and annoying.

What to do, preferably every project has a clean development environment, only for this project, but we can not for each project with a computer bar, have, virtual machines, for each project with a virtual machine, the development of a to start a virtual machine, so that each development environment independent of each other, clean. There is also a problem, our project has a number of developers, how to protect everyone's development environment are the same, always can not everyone click the mouse, fill in the configuration parameters, built after a software installation, this is too troublesome, too geek. What we want is that the environment is only configured once, and then the environment can be packaged deliver to others , when someone gets it, it can be used directly. There is no such thing, there must be some, vagrant, it is used to do this.

  2. What is Homestead?

Homestead on the above Gray label Laravel the official package for us to use the environment, that is, resource preparation in the first file Virtualbox.box. It contains the following things:

Ubuntu 16.04
Git
PHP 7.0
Nginx
MySQL
mariadb
Sqlite3
Postgres Node (with PM2, Bower, Grunt, and Gulp)
Redis
Memcached

Third, installation steps

Git Bash under

1. Enter Vagrant Box Add Metadata.json

2. Enter git clone https://github.com/laravel/homestead.git Homestead

3. Enter Bash init.sh

At this point, your user directory will have a more than one. Homestead folder, which has a Homestead.yaml file, this is homestead configuration file, we often use in our daily development. Now edit this file

---
#虚拟机的ip地址
IP: "192.168.10.10"
#分配给虚拟的内存
memory:2048
#cpu数
cpus:2
provider: VirtualBox
Authorize: ~/.ssh/id_rsa.pub
keys:
-~/.ssh/id_rsa
#设置主机与虚拟机的共享文件夹
folders:
#主机
-map: ~/code/test
#虚拟机 to
:/home/vagrant/code/test
#设置域名与访问地址
sites:
- Map:test.app to
:/home/vagrant/code/test/public
#数据库
databases:
-Homestead
# Blackfire:
#-Id:foo #
Token:bar # client-id:foo # client-token:bar #
ports:
#-send:50000
   
    # to:5000 #
-send:7777
# to:777 #
PROTOCOL:UDP
   

After editing, create the code folder in the user directory, which creates a test folder inside the folder. The virtual machine IP address is then bound to the domain name. Edit File C:\Windows\System32\drivers\etc The hosts add one line: 192.168.10.10 test.app . (You may want to modify file permissions to increase)

4. Input Ssh-keygen

Display: Enter file in which to save the key (/C/USERS/PC/.SSH/ID_RSA):

Whether it goes directly to the car, and then lets you enter the password, it is also a direct return.

5. Input vagrant up

6. Input vagrant SSH

At this point, you have entered the virtual machine, create a new code folder, go into the code and create a new test folder.

The Ok,homestead development environment has been matched.

Enter exit exit virtual machine input vagrant halt shut down virtual machine input vagrant View common commands

The above is a small set to introduce the window under the Windows Homestead Development Environment Installation Detailed tutorial, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

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.