Installation on Local Machine

Published: Thursday, December 12th, 2013 by Chris Zieba


The following installation will get you up and running on your local machine.

Requirments

You need to have node v>=0.8.8 installed on your system, along with mongoDB and Apache FOP. You must also have a Java compiler on your machine to build the output files.

Install Packages

		sudo apt-get update
sudo apt-get upgrade
sudo apt-get install graphviz pdftk

Install NodeJS

The version of NodeJS available in the Official Ubuntu Package Repository does not meet the minimum version required to run all the features of LogicPull, so it is built from source. More information on how to install nodejs.

		sudo su
cd /opt
wget http://nodejs.org/dist/v0.8.8/node-v0.8.8.tar.gz
tar -zxf node-v0.8.8.tar.gz
cd node-v0.8.8
./configure && make && sudo make install
exit

Install Apache FOP

Apache Fop does not have package in the Ubuntu Repo, so its binary is downloaded directly. More information on how to install Apache FOP.

sudo su
wget http://apache.mirror.nexicom.net/xmlgraphics/fop/binaries/fop-1.1-bin.zip
unzip fop-1.1-bin.zip -d /opt/
exit

Make sure that Apache FOP has the correct permissions to execute.

sudo chmod a+x /opt/fop-1.1/fop

Install LogicPull

The source code for LogicPull is located on github. You can install LogicPull in any directory you want, but for the purpose of this guide, we will install it in /srv/www/LogicPull/.

Download the source using github. You can also download the zip file directly.

cd /srv/www
git clone https://github.com/ChrisZieba/LogicPull.git

Create the needed directories.

cd /srv/www/LogicPull
mkdir generated uploads logs generated/output generated/answers generated/tmp uploads/deliverables logs/forever public/javascripts/preload

Make sure the directories have the correct permissions.

sudo chmod -R 755 public/

The mongo database needs to be initialized. This will add an admin user, and set up all the tables in the LogicPull database.

mongo LogicPull /srv/www/LogicPull/bin/db/init.js

To avoid any conflict when pulling updates, make sure git does not track files that are likely to be modified.

cd /srv/www/LogicPull
git update-index --assume-unchanged public/robots.txt
git update-index --assume-unchanged public/sitemap.xml
git update-index --assume-unchanged config.js
git update-index --assume-unchanged Gruntfile.js
cd node_modules/
git update-index --assume-unchanged $(git ls-files | tr '\n' ' ')

Rebuild the modules if you are on 32 bit system.

cd /srv/www/LogicPull
rm -rf node_modules/
npm install

LogicPull comes with a configuration file located in config.js. Each line is commented to provide a description of its purpose. Make sure you set the correct settings based on the environment you plan to run in. The following settings must be set to run LogicPull:.

Now we can start LogicPull with the following command.

NODE_ENV=development node LogicPull.js