02. Installing the codebase - findsorguk/findsorguk GitHub Wiki

Installing source code

To deploy source code, we've gone down the basic route of using Github as the mechanism. We work with branches, and merge code changes into the master branch. The following documents how to install onto a Linux box.

First off, change directory to the folder in which you keep your web sites. For this example we will use /var/www/

cd /var/www/

Then clone the github repository to a folder name of your choice. For this we will call our folder finds.org.uk and you will probably need to be running as sudo user or www-data

sudo git clone https://github.com/findsorguk/findsorguk.git finds.org.uk

Once cloned, you will need to pull all the submodules into the repo (these are not initialised on deployment.) So change directory to the folder you just pulled code into:

cd /var/www/finds.org.uk

Then init the submodules:

sudo git submodule update --init --recursive

Now we need to make sure a few folders exist and that permissions are correct. First make a directory for the images to be installed into (this isn't included in the source code as we use a linked folder in our production environment with some extra stuff in it. I didn't want Git to interfere..)

sudo mkdir public_html/images
sudo chmod 777 public_html/images

Set the permissions for the cache folder:

sudo mkdir app/cache
sudo chmod 777 app/cache/

Set the owner for the folders to www-data (recursively):

sudo chown -R www-data:www-data /var/www/finds.org.uk

Now you need to install and set up the [mysql database](https://github.com/findsorguk/findsorguk/wiki/03. Installing-and-populating-the-mysql-database).