Skip to content
This repository was archived by the owner on Jan 25, 2020. It is now read-only.

Setup the Development Environment

Voydz edited this page Mar 20, 2015 · 10 revisions

Setup the Development Environment

Already got the Virtual Machine up and running? Follow the Project Setup and Maintenance guide for required first-start instructions and maintenance operations.

Table of Contents

  1. Required Software
  2. Host Setup
  3. Boot it up

Required Software

In order to run the Vain development environment, you have to install the following tools on your machine:

Optional

The following software is optional, but in some cases it may improve productivity. Furthermore it will reflect the later production state and use case much more.

All dependencies which Vain will actually need are installed within the Laravel Homestead Virtual Machine.

Host Setup

Software Installation

Install Virtualbox and Vagrant and Laravel Homestead (in that order) by following the installation manuals on the corresponding pages.

Configuring Homestead

After you installed Homestead fire up your terminal and type homestead edit. Your favorite text editor will show up with the Homestead.yaml file opened.

Configure the IP, Memory, CPUs, SSH Key and Shared Folders to your belongings. Finally we edit the sites array and add the following entry:

sites:
    - map: vain.app
      to: /home/vagrant/Code/vain/public

NOTE: If you changed the Shared Folders you have to replace /home/vagrant/Code

Finally tell Homestead, that we need a vain database for our environment by adding it to the databases array like so:

databases:
    - vain

As an reference from the Laravel Homestead guide, the following ports are forwarded to your Homestead environment:

  • SSH: 2222 -> Forwards To 22
  • HTTP: 8000 -> Forwards To 80
  • MySQL: 33060 -> Forwards To 3306

Edit your machine's hosts file

In order to access your application properly through vain.app in your browser, I highly encourage you to add the following line to your /etc/hostsfile replacing x.x.x.x IP with the one from Homestead.yaml:

x.x.x.x vain.app

A word on social network login

If you want to test or develop socialite (G+, Twitter, Facebook), you have to:

  1. Insert x.x.x.x local.vain.de to your /etc/hosts file, too
  2. Tell nginx that it has to serve that domain. Therefore, open an SSH Connection with homestead ssh and sudo vim /etc/nginx/sites-available/vain.app.
  3. Find the line server_name vain.app; and change it to server_name vain.app local.vain.de;.
  4. Restart nginx with sudo service restart nginx.

Boot it up

We are finally able to boot our VM using the vagrant like keywords up, resume, suspend, and halt only with the use of the homestead command.

So boot it up from anywhere with homestead up.

Where to go from here?

Follow the Project Setup and Maintenance guide for required first-start instructions and maintenance operations.

Clone this wiki locally