Windows installation vagrant and Laravel Homestead

Source: Internet
Author: User
Tags vps
A previous article introduced the installation of composer, this article describes the installation of Vagrant and homestead.

Original: EKAN001.COM/ARTICLE/40

Preparatory work

VirtualBox virtual machines, based on the Vagrant VirtualBox or VMware-based Virtualization Environment Deployment tool, you can package a virtual machine (VBox) to others. Homestead Laravel Official VBox, integrated environment, and a set of specially crafted command-line tools. Xshell This is a Windows SSH & Shell tool, similar to the SECURECRT, putty and so on.

Installing VirtualBox

This installation is relatively simple, Baidu a bit, download installation can.

Installing vagrant

To https://www.vagrantup.com/downloads.html download, speed a bit slow, endure it. The installation process is equally silly and skipped.

Reboot after installation, and then open the Cmd,vagrant--version command should take effect.

Download Homestead VBox

by command

Vagrant Box Add Laravel/homestead https://atlas.hashicorp.com/laravel/boxes/homestead

can automatically download Homestead VBox, but the domestic network you understand, turtle speed.

Recommend yourself to have VPS for classmates, on the VPS through

Wget-o Homestead.box Https://atlas.hashicorp.com/laravel/boxes/homestead/versions/0.2.6/providers/virtualbox.box

Download it manually, then download it locally from the VPS, or try the Thunderbolt download. Anyway, find a way to download the box file and add it to vagrant with the following command

Vagrant box Add./homestead.box

./homestead.box is the path where the box file is located, I am here to execute the command directly from the CD to the directory where the file is located.

The addition process may allow you to choose VirtualBox or VMware, obviously choosing VirtualBox. Other default.

Installing the Homestead command-line tool

Installing the Homestead command-line tool via composer

Composer global require "laravel/homestead=~2.0"

About composer This piece, the previous article "Windows installs the composer" The comparison detailed, does not understand can go to look.

And then execute

Homestead Init

A homestead.yaml file will be generated under ~/.homestead/, you can edit it manually, or you can use the command

Homestead Edit

Edit it.

Configuration

You can see that there are a series of parameters in the Homestead.yaml, the meaning of the parameters in the Laravel official manual described in more detail, here no longer repeat. What do not understand can leave a message.

Start

Execute with CMD

Homestead Up

To start the virtual machine.

Connect to SSH

Open the Xshell and create a new link:

Address: 127.0.0.1 Port: 2222 user authentication method: Public key user name: Vagrant user key: Id_rsa file generated by Ssh-keygen tool.

End

The whole environment is finished, then happy to write code.

  • 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.