Skip to content
adewinter edited this page Jan 11, 2011 · 11 revisions

Installing Data HQ on your machine

Getting the source code

First clone the data hq git repository off of github. Install git (on ubuntu it should be something like

sudo apt-get install git

make a new folder in an arbitrary location (you'll be moving it to the right place in a moment) then run:

git clone git://github.com/dimagi/data-hq.git

This command clones the entire repo (including our unstable and dev branches). You now need to switch to the correct branch in order to ensure that you're using the stable code. Run the following command:

git checkout -b moz remotes/origin/moz 

This should switch you to the correct branch.

Next place the datahq folder contents in your /opt folder, such that the directory structure looks as follows:

/opt
-- datahq_src
    -- data-hq
        -- datahq
            |-- apache
            |    -- media
            |-- apps
            |   |-- django_granular_permissions
            |   |-- django_rest_interface
            |   |-- django_tables
            |   |-- domain
            |   |-- downloads
            |   |-- hqwebapp
            |   |-- phone
            |   |-- program
            |   |-- receiver
            |   |-- user_registration
            |    -- xformmanager
            |-- data
            |   |-- attachments
            |   |-- builds
            |   |-- schemas
            |    -- submissions
            |-- lib
            |-- shared_code
            |   |-- djangoplus
            |    -- transformers
            -- util

NOTE! The data folder (/opt/datahq_src/data-hq/datahq/data) should contain ALL the folders listed above. If it does not, please create those folders.

It is critical that the directory structure looks exactly like this so that the apache (and mod_wsgi) scripts look in the correct place for the Data-hq source code.

Once you have apache installed and set up, navigate to the following directory:

/etc/apache2/sites-enabled

Now create a symbolic link in this folder that points to the apache config file in your datahq directory:

sudo ln -s /var/django_sites/datahq/apache/apache-staging.conf datahq.conf

This is what my sites-enabled folder looks like when I type ls -la:

**lrwxrwxrwx 1 root root 51 2010-11-30 07:06 datahq.conf->/var/django_sites/datahq/apache/apache-staging.conf**

Next navigate to the /var folder and create a folder called django_sites and cd into that new folder.

Create another symlink (pointing the django_sites folder to the datahq source code in the opt folder):

ln -s /opt/datahq_src/data-hq/datahq/ datahq

Lastly, download the JavaRosa binaries located here. And extract the archive and copy the contents of the
/dist/Nokia/S40-generic/ folder into
/opt/datahq_src/data-hq/datahq/lib.

Now, all the folders and code should be in the correct place. Restart apache and see if you can access the website (navigate to http://localhost/ )