[SOLVED] How to install ODK aggregate in ubuntu server?

February 10, 2017 - 15:07

Open Data Kit (ODK) is an open-source suite of tools that helps to Build survey form, Collect data on a mobile device and send it to a server and Aggregate the collected data on a server and extract it in useful formats. ODK Aggregate can be deployed on Google's App Engine, by creating google account. ODK Aggregate can also be deployed locally on a Tomcat server backed with a MySQL or PostgreSQL database server.

Steps to setup ODK Aggregate in our server,

  1. Install Java
    $ sudo apt-get install java7-jdk

    To check whether java installed properly , use

    java -version
  2. Then open ~/.bashrc with your editor and add: export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 at the bottom of that file.
  3. Install tomcat7
    sudo apt-get install tomcat7
  4. Edit context.xml (under Tomcat 7's conf directory - /var/lib/tomcat7/conf) to have the attribute 'useHttpOnly' set to false.
  5. Download the correct version of ODK Aggregator and then install it.
    sudo wget  https://s3.amazonaws.com/opendatakit.downloads/ODK\ Aggregate\ v1.4.7\ linux-x64-installer.run (For 64 bit)
    $ sudo chmod +x ODK\ Aggregate\ v1.4.7\ linux-x64-installer.run
    $ ./ODK\ Aggregate\ v1.4.7\ linux-x64-installer.run
    

    The installer does not install anything, but will guide you through configuring ODK Aggregate for Tomcat and MySQL/PostgreSQL.
    Set Parent Directory to your path.
    - Platform: MySQL
    - No SSL (for now)
    - HTTP Port: 8080
    - IP Address or DNS: localhost

  6. Download and Install Latest MySQL Connector (http://dev.mysql.com/downloads/connector/j/5.1.html)
    $ sudo wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.36.tar.gz
    $ sudo tar -xzf mysql-connector-java-5.1.36.tar.gz
    $ sudo cp mysql-connector-java-5.1.36/mysql-connector-java-5.1.36-bin.jar /usr/share/tomcat7/lib/

    - Database Port: 3306
    - Database Host: 127.0.0.1
    - Continue...

  7. The installer will produce a WAR file (web archive) containing the configured ODK Aggregate server, a create_db_and_user.sql script for creating the database and user and a Readme.html file with instructions on how to complete the installation.
  8. Set up database (run script)
  9. Place war file on web server
    $ cd ~/ODK Aggregate
    $ sudo cp ODK\ Aggregate/ODKAggregate.war /var/lib/tomcat7/webapps/
    

    - the war file should automatically unpack and create an ODKAggregate directory.

  10. Restart Apache
    sudo service tomcat7 restart
  11. Visit http://domain_name:8080/ODKAggregate/

    NOTE:
    It may take a few moments for the Apache Tomcat server to detect the ODKAggregate.war. if you get a 404 error, wait a few moments then refresh your browser.
    If you want ODKAggregate to be reached at just http://domain_name:8080/, you can rename it to ROOT.war before copying it to the /webapps directory.

Post your comments / questions