Tweet about this on TwitterShare on FacebookShare on Google+Share on StumbleUponShare on TumblrShare on RedditPin on PinterestEmail this to someone
Apache PHP MySQL

Apache PHP MySQL

In this part I will go through the steps to setup your development environment. I will be using Ubuntu for this tutorial.
Please note I will not cover how to install Apache2, PHP and MySQL, in case you need help for that please refer ApacheMySQLPHP from Ubuntu Documentation.

1. Setup Virtual Host

A sip of Coffee with Laravel and Backbone - Book
I normally like to have different virtual hosts for each project which points to a folder in my home directory, this will help you to understand any issues and behaviors in production environment, for this tutorial we will create virtual host with a name http://lbc.dev

Open Ubuntu terminal and change working directory to /etc/apache2/sites-available

Open file called default in gedit using the command

sudo gedit default

Create new VirtualHost section as follows.

Here [YOU] needs to be replaced with your login name (home directory), also make sure to have folder called lbc in your home directory. Save changes and exit from gedit

2. Update hosts File

Now execute following command to edit hosts file, we need to add entry for our new site lbc.dev
sudo gedit /etc/hosts

add a new entry as below and save the file.

127.0.0.1               lbc.dev

Try issuing ping command to see it routes correctly to 127.0.0.1

ping lbc.dev

 3. Create Index Page for the Site

Now go to your site directory /home/[YOU]/lbc

create a file with following content using favorite text editor and save it as index.php

4. Restart Apache and Test the Site

Restart Apache in order to load latest changes we made to its configuration files.

sudo /etc/init.d/apache2 restart

Open your browser (I normally use Chrome) and type http://lbc.dev/

Now you should see phpInfo output on your browser if you have configured everything correctly.

Since we made index.php to check whether apache2 configuration is correct, now you can remove it as we need to install Laravel in this folder.

Posts of this series
Laravel, Backbone.js + Coffeescript Tutorial Part I – Introduction
Laravel, Backbone.js + Coffeescript Tutorial Part II – Setup
Laravel, Backbone.js + Coffeescript Tutorial Part III – Install Laravel
Laravel, Backbone.js + Coffeescript Tutorial Part IV – Database
Laravel, Backbone.js + Coffeescript Tutorial Part V – Data model
Laravel, Backbone.js + Coffeescript Tutorial Part VI – REST API
Laravel, Backbone.js + Coffeescript Tutorial Part VII – REST API
Laravel, Backbone.js + Coffeescript Tutorial Part VIII – Views
Laravel, Backbone.js + Coffeescript Tutorial Part IX – Coffeescript
Laravel, Backbone.js + Coffeescript Tutorial Part X – Backbone
Laravel, Backbone.js + Coffeescript Tutorial Part XI – Backbone
Laravel, Backbone.js + Coffeescript Tutorial Part XII – Backbone
Laravel, Backbone.js + Coffeescript Tutorial Part XIII – Backbone

Tweet about this on TwitterShare on FacebookShare on Google+Share on StumbleUponShare on TumblrShare on RedditPin on PinterestEmail this to someone