Vagrant Getting Started

-Install VirtualBox
-Install Vagrant
-Install Git
-Install Homestead Vagrant Box
    Run Git Shell
        It shows as below
        Welcome to Portable Git (version 1.9.5-preview20141217)
        Run 'git help git' to display the help index.
        Run 'git help ' to display help for specific commands.
   
    vagrant box add laravel/homestead                (this will download and create a directory ~/.vagrant.d in user's home directory)
    cd ~
    git clone https://github.com/laravel/homestead.git Homestead            (this will create ~/Homestead directory in user's home directory)
    cd Homestead
    bash init.sh   (this will create ~/.homestead directory in user's home directory)
-Configuring Homestead
    cd ~/.homestead
    vim Homestead.yaml
        set
            ip: "192.168.10.10"      (This IP is the vagrant virtual server's IP)
            ...
            provider: virtualbox
            ...
            authorize: ~/.ssh/homestead_rsa.pub

            keys:
                - ~/.ssh/homestead_rsa

                (Note: to generate homestead_rsa.pub and homestead_rsa, Generate SSH Key Open Bitvise SSH Client -> Client key manager -> Export Both public and private key with rsa algorithm in OpenSSH format (Ex. homestead_rsa, homestead_rsa.pub))
               
            folders:
                - map: C:/Code                (This is our local path)
                  to: /home/vagrant/Code    (This is vagrant virtual server path)

            sites:
                - map: homestead.app                        (This is a virtual domain which we configure in /etc/hosts)
                  to: /home/vagrant/Code/Laravel/public        (This is a path on vagrant virtual server)
                - map: asgardcms.app
                  to: /home/vagrant/Code/asgardcms/public

            databases:
                - asgardcms
                - homestead
-Create a directory
    mkdir c:/Code
-Add hosts  /etc/hosts
192.168.10.10    asgardcms.app      (This IP is the vagrant virtual server's IP)
-Start vagrant
    cd ~/Homestead                (Note: ~ is user home directory, in Window ~ is c:/Users/{UserName})
    vagrant up         (vagrant reload)
-Remote to vagrant
    vagrant ssh
        After remote successfully, it displays
        Welcome to Ubuntu 14.04.3 LTS (GNU/Linux 3.19.0-25-generic x86_64)

         * Documentation:  https://help.ubuntu.com/
        Last login: Mon Dec 21 15:06:01 2015 from 10.0.2.2
        vagrant@homestead:~$ ls   
   
        To remote to mysql server
            mysql -u homestead -p
                password: secret

-create a project
    cd c:/Code
    composer create-project asgardcms/platform asgardcms (this will create asgardcms directory and load project from git server)
    cd asgardcms
    php artisan asgard:install
        At the end, it will ask to configure its database
         Enter your database host [localhost]:
         > localhost

         Enter your database name [homestead]:
         > homestead

         Enter your database username [homestead]:
         > homestead

         Enter your database password (leave for no password) [secret]:
         > secret

        Database successfully configured

        After database successfully configured
          User Module
          Starting the User Module setup...

         Enter your first name:
         >

         Enter your last name:
         >

         Enter your email address:
         >

         Enter a password:
         >

         Please confirm your password:
         >

        Admin account created!
        Platform ready! You can now login with your username and password at /backend
        vagrant@homestead:~/Code/asgardcms$
       
-To test
    Open a web browser then go to asgardcms.app or asgardcms.app/backend (username/password)
   
   
vagrant destroy vagrant_id
vagrant global-status
vagrant provision


Per Project Installation
=========================
Installing Homestead per project may be beneficial if you wish to ship a Vagrantfile with your project, allowing others working on the project to simply vagrant up.

To install Homestead directly into your project, require it using Composer
    composer require laravel/homestead --dev

    vendor\bin\homestead make  (this command generates Vagrantfile and Homestead.yaml file in your project root. It will automatically configure the sites and folders directives in the Homestead.yaml file)