Installing nanoDMS

Something to explain

Install system libraries

You need to install this libraries to run the application and pip to install the python libraries.

    sudo aptitude install python-pip python-dev python-psycopg2 libpq-dev

Install nano-parser library

You need to install the nano-parser library that is used to parse the ISA-TAB-Nano files.

    pip install dist/nano_parser-x.x-py2.7.egg

Install apache

You need to install apache or use any existing installation to act like a frontend.

    sudo aptitude install apache2
To communicate apache with the applications you need to use mod_wsgi.

    sudo aptitude install libapache2-mod-wsgi
To serve the media files uploaded to application you need to use mod_xsendfile.

    sudo aptitude install libapache2-mod-xsendfile
Configure apache writing this code in a virtualhost section (by default the configuration file is: /etc/apache2/sites-available/default).

        #start of nanodms configuration
        WSGIPassAuthorization On
        # enable xsendfile
        XSendFile on
        XSendFilePath /var/www/nanodms/media/
        WSGIDaemonProcess nanodms threads=15 display-name=%{GROUP} python-path=/var/www/nanodms/
        WSGIProcessGroup nanodms
        # nanodms
        WSGIScriptAlias /nanodms /var/www/nanodms/isatabnano/ process-group=nanodms
        <Directory /var/www/nanodms/isatabnano>
                Order deny,allow
                Allow from all
        Alias /nanodms/static/ /var/www/nanodms/static/
        <Directory /var/www/nanodms/static/>
            Order deny,allow
            Allow from all
        #end of nanodms configuration
Download the application and extract the content in the apache directory (by default the directory is /var/www/).

    wget http://path/to/nanodms
    mkdir /var/www/nanodms
    tar -xvf nanoDms.tar -C /var/www/nanodms
Collect the static files of the nanodms to generate a folder with all static files (javascripts, css, images...) that is served by apache

    cd /var/www/nanodms
    python collectstatic

Install python libraries

NanoDMS uses some python libraries, you need to install them

    cd /var/www/nanodms
    pip install -r requirements.txt

Install PostgreSQL

You need to install one database, that it's used to store the users and the permissions of the application, you can PostgreSQL or any other compatible with Django 1.5

    sudo aptitude install postgresql
Create the database and the user for the application:

    sudo su – postgre
    CREATE USER nanodms CREATEDB ENCRYPTED PASSWORD 'nanodms_user_password';
    CREATE DATABASE  nanodms WITH OWNER nanodms;
Configure PostgreSQL to handle encrypted passwords:

    sudo vi /etc/postgresql/9.1/main/pg_hba.conf
    # find local configuration
    local   all             all                                     md5
    sudo /etc/init.d/postgresql restart
Configure the application to use the new database editing the located at /var/www/nanodms/isatabnano/

        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2', # Can be 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
            'NAME': 'nanodms',                                  # Or path to database file if using sqlite3.
            # The following settings are not used with sqlite3:
            'USER': 'nanodms',
            'PASSWORD': 'nanodms_user_password',
            'HOST': '',                                # Empty for localhost through domain sockets or '' for localhost through TCP.
            'PORT': '',                                         # Set to empty string for default.
Create the tables

    cd /var/www/nanodms
    python syncdb
    python schemamigration web --initial
    python migrate web

Install MongoDB

Install MongoDB, that it's used to store the files.

    sudo aptitude install mongodb

Restart apache

Restart apache to apply the new configuration and start the nanoDMS.

    sudo service apache2 restart
You can check that everything works entering to on URL like this: