Skip to content

Instantly share code, notes, and snippets.

@rummykhan
Last active August 7, 2016 21:58
Show Gist options
  • Save rummykhan/e87e9fe9d182fd1ed6f28f2c16bcdd0c to your computer and use it in GitHub Desktop.
Save rummykhan/e87e9fe9d182fd1ed6f28f2c16bcdd0c to your computer and use it in GitHub Desktop.
# Setting Up Laravel/homestead on Windows
-----------------------------------------
1. Install virtual box (https://www.virtualbox.org/wiki/Downloads)
2. Install vagrant (https://www.vagrantup.com/)
3. Install Git (https://git-scm.com/download)
4. Download Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
5. Download PuttyGen (http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html)
~ in any directory of your pc
------------------------------
# vagrant box add laravel/homestead
~ Goto home dir C:\Users\{YourUserName}
---------------------------------------
# git clone https://github.com/laravel/homestead.git Homestead
~ Open Git CMD, Goto Homestead dir
-----------------------------------
# bash init.sh
~ The above command will create ./homestead dir in C:\Users\{YourUserName}
-------------------------------------------------------------------------
~ Creat Publi/Private Key Pair
------------------------------
# ssh-keygen -t rsa -C '[email protected]'
~ The above command will generate keys in C:\Users\{YourUserName}\.ssh\
---------------------------------------------------------------
~ .id_rsa ===> private key.
-------------------------------
~ .id_rsa.pub ===> Public Key.
-------------------------------
~ Now open the C:\Users\{YourUserName}\.homestead\Homestead.yaml and configure the folder
----------------------------------------------------------------------------------
folders:
- map: C:\wamp\www\
to: /home/vagrant/Code
~ The above lines mean map everything inside C:\wamp\www to /home/vagrant/Code folder
--------------------------------------------------------------------------------------
sites:
- map: myapp.dev
to: /home/vagrant/Code/myapp/public
~ The above lines mean that which domain name will point to which directory. remember C:\wamp\www is mapped to code so think and fix it.
----------------------------------------------------------------------------------------------------------------------------------------
~ Next Step is to modify the C:\Windows\System32\Drivers\etc\hosts file and add
-------------------------------------------------------------------------------
192.168.10.10 myapp.dev
~ now goto C:\Users\{YourUserName}\Homestead
--------------------------------------------
# vagrant up
~ The above command will initialize the virtual machine.
--------------------------------------------------------
~ Now we need to generate the private key.
------------------------------------------
1. Open PuttyGen
2. Click Load
3. Goto C:\Users\{YourUserName}\.ssh\
4. Click All Files
5. Select id_rsa
* Now goto file and save private key.
------------------------------------
1. Open Putty
2. Goto Auth
3. Select the key you just saved.
4. Goto Session
5. Write IP: 192.168.10.10
6. click connect
* username for the box is vagrant
---------------------------------
* password for box is vagrant
---------------------------------
* You mapped folders will be in /home/vagrant/Code
--------------------------------------------------
* database username is homestead
--------------------------------
* database password is secret
-------------------------------
~ Resources
------------
*Laravel/Homestead Docs = https://laravel.com/docs/5.2/homestead
-----------------------------------------------------------------
*TeamTree House = http://blog.teamtreehouse.com/laravel-homestead-on-windows
----------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment