Skip to content

Setting up the environment

Rhys Young edited this page Feb 12, 2018 · 1 revision

Steps to setting up the environment:

Legend

  • host computer: $
  • server environment: >>

Download and install Vagrant

https://www.vagrantup.com/downloads.html

Download and install Virtual box

https://www.virtualbox.org/wiki/Downloads

Download laravel/homestead

If not using my uploaded file:

$ vagrant box add laravel/homestead

If using my uploaded file:

$ vagrant box add laravel/homestead /your/directory/virtualbox.box

Set up homestead

$ git clone https://github.com/laravel/homestead.git ~/Homestead
$ cd ~/Homestead
$ git checkout v7.1.2
$ bash init.sh

Edit homestead environment file

$ nano homestead.yaml
Note: Map folders how you want them in homestead.yaml

Replace contents of Vagrantfile with:

https://hastebin.com/odogehenuy.rb
Note: Edit synced folder directory to suit your needs

Edit hosts file

$ sudo nano /etc/hosts
add the line "192.168.10.10 your.domain “

Start and connect to server

$ cd ~/Homestead
$ vagrant up
$ vagrant ssh

On vagrant server

>> cd /home/vagrant
>> mkdir Code
>> mkdir Laravel

If nginx has no site listed in sites-available directory:

>> sudo nano /etc/nginx/sites-available/mysite
paste this https://hastebin.com/kalipoposu.nginx and close the file

If you did last step:

>> sudo ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/mysite >> service nginx restart

Additional notes (perform commands in ~/Homestead)

  • start server: $ vagrant up
  • stop server: $ vagrant halt
  • ssh to server: $ vagrant ssh
  • restart server: $ vagrant reload

Should be ready to start cloning repository now!

Clone this wiki locally