Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Improved the entire document so it's up to date.

...

  1. JDK 1.7 or above (1.8 is recommended)

  2. Development Editor

  3. CouchDB 1.6.1 port :5984. (Remember to put properties file, bean id and configure in appcontext of spring); /start couchDB

  4. PostgresSQL 9.1 or above (Install as a service since its only used for reporting) - Port: 5432; /start postgres windows service

  5. ActiveMQ 5.4.2 (To stop Exception of JMS for ActiveMQ appearing in console, change in activemq.prop.. tcp:// to vm:// since both are on same server); /start ActiveMQ

  6. Mysql 5.6 or above (This is required by the Quartz plugin and opensrp-web)
  7. Maven 2 or above
  8. Apache-Tomcat 6 or above (Tomcat 7 is recommended)

  9. OpenMRS version 1.12.x


Here is a detailed explanation of OpenSRP installation process for a Debian based Linux machine. 
  1. You will need to Install jdk1.7 to run the application. To do so, first install OpenJDK or Java JDK (both can be used to build OpenSRP however OpenJDK is recommended). 

    1. To install OpenJDK run the following command from terminal:

       


      Code Block
      languagebash
      sudo apt-get install openjdk-7-jdk


    2. After
    install
    1. installing Java, set the JAVA_HOME variable - you will need this later in the set up so be sure to set it correctly.
     First
      1. First find out the path of your Java Installation

        Code Block
        languagebash
        sudo update-alternatives --config java
       It

      1. It should return something like this:

        No Format
        nopaneltrue
        There are 2 choices for the alternative java (providing /usr/bin/java).
        
      1. Selection    Path                                            Priority   Status
        ------------------------------------------------------------
        * 0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1062      auto mode
          1            /usr/lib/jvm/java-6-openjdk-amd64/jre/bin/java   1061      manual mode
          2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1062      manual mode
        
        Press enter to keep the current choice[*], or type selection number:
          b.

      1. Copy your installed Java path and put it into file /etc/environment

        Code Block
        languagebash
        sudo nano /etc/environment
    c.
      1. Add the following line at the end of the file (Replace YOUR_PATH with your Java path above up to the base directory /usr/lib/jvm/java-7-openjdk-amd64/ There's no need to include /jre/bin/java

           JAVA
      1. JAVA_HOME="YOUR _PATH"
           d.

      1. Reload this file

    :       source
      1. Code Block
        languagebash
        source /etc/environment
           e.
      1. Test it by executing

              echo
      1. Code Block
        languagebash
        echo $JAVA_HOME
         If
      1. If you have set it correctly, your path should now show on screen (ie. /usr/lib/jvm/java-7-openjdk-amd64

    )For development environment install your preferred Java editor Eclipse, STS, NetBeans IDE, IntelliJ IDEA etc. STS and IntelliJ IDEA is preferable.
    You can download STS (Spring Tools Suite) here
    You can download IntelliJ IDEA here

    Clone OpenSRP Server git repository from https://github.com/OpenSRP/opensrp-server using git clone https://github.com/OpenSRP/opensrp-server.git

    If on eclipse, you can either use:  

    Step I:
    --------
    File --> Import --> URI (https://github.com/OpenSRP/opensrp-server.git)
    Step II:
    ---------
    File --> Import --> from localRepository (after cloning as directed above)For data storage system install No-SQL and browser based database server CouchDB. CouchDB 1.6 is recommended. Follow
      1. /)

  2. CouchDB v 1.6.1 is used for data storage. Your package manager may have a different version. In this case, we recommend installing a PPA for the development environment. Production setup may be different. CouchDB 2.x is not supported (v 2.x stopped supporting the PPA as well). 

    Code Block
    languagebash
    sudo apt-get install software-properties-common
    sudo add-apt-repository ppa:couchdb/stable
    sudo apt-get update
    sudo apt-get install couchdb

    Alternatively, follow the CouchDB setup instructions for your environment here.

  3. To use

    (Optional) The OpenSRP reporting module

    it needs to install

    and ETL process uses PostgreSQL 9.1 or above.

    In OpenSRP previous architecture ANM location is managed by reporting module and reporting module used PostgreSQL server. Now in the current structure User, Provider and Location management are handled by OpenMRS. So, instead of reporting module OpenMRS instance is using for security management and reporting management. User authentication process is controlled by rest call from OpenSRP to OpenMRS.

    1. To install PostgreSQL execute the

    commands step by step
    1. following commands

      Code Block
      languagebash
      sudo apt-get update
    1. 
      sudo apt-get install postgresql postgresql-contrib
    a)

    1. Connect to the default database with user postgres

    :
    1. Code Block
      languagebash
      sudo -u postgres psql template1
    b)

    1. Set the password for user postgres, then exit psql (Ctrl-D)

    :
    1. Code Block
      languagebash
      ALTER USER postgres with encrypted password 'xxxxxxx';
     
    c)

    1. Edit the pg_hba.conf file

    :
    1. Code Block
      languagebash
      sudo vi /etc/postgresql/9.1/main/pg_hba.conf


    2. And change "peer" to "md5" on the line concerningpostgres

    :

    1. local all postgres peer md5

     
    d)
    1. Restart the database

    :
    1. Code Block
      languagebash
      sudo /etc/init.d/postgresql restart


    2. Whenpostgresqlservice stops use the command to start

      Code Block
      languagebash
      sudo service postgresql start
    For using

  4. We use Apache ActiveMQ for scheduling activities on the server side (JMS, Quartz, Motech, etc.

  5. install we will need to install Apache ActiveMQ 
  6. )

    1. To install Apache ActiveMQ download
  7. it
    1. the latest stable release from Apache ActiveMQ Site 
    2. Extract

  8. your download to your preferred folder, for example /home/apache-activemq or move it to /opt where optional software package are intended to be placed
    sudo mv apache-activemq-x.x.x /opt
    Add some configuration to wrapper.conf file by the commandsudo vi /opt/
    1. the download to /opt

      Code Block
      languagebash
      sudo tar -xf apache-activemq-x.x.x
  9. /bin/linux-x86-64/wrapper.conf

    In wrapper.conf configure home and base paths as your directory path and save

    set.default.ACTIVEMQ_HOME=/opt/apache-activemq-x.x.x

    set.default.ACTIVEMQ_BASE=/opt/apache-activemq-x.x.x
    1. -bin.tar.gz -C /opt/


    2. To create an ActiveMQ service, create a soft link in init.d using the following command:

      Code Block
      languagebash
      sudo ln -
  10. s
    1. snf /opt/apache-activemq-x.x.x/bin/linux-x86-64/activemq /etc/init.d/activemq
  11.  sudo service activemq  start

    To be ensured check the following urls
    1. 
      sudo update-rc.d activemq start 66 3 5 . stop 34 0 1 6 .
      sudo service activemq start


    2. Verify it's running by checking the following url:
      http://localhost:8161/
  12. fileserver/
  13.  Install Maven 2 or above. To install from terminal execute the command:following command

    Code Block
    languagebash
    sudo apt-get install
    maven
    Run mvn clean install from the root directory of opensrp-server. If there are test failures, you can run the mvn clean install -Dmaven.test.skip=true to build and install all the different modules. It is also possible to build each module separately but this has to adhere to the dependency hierarchy i.e.

    a) opensrp-common

    b) opensrp-interface

    c) opensrp-api

    d) opensrp-form

    e) opensrp-core

    f) opensrp-register

    g) opensrp-connector

    h) opensrp-reporting (if applicable)

    e) opensrp-web

    To Install apache-tomcat
     maven


  14. Install tomcat7 you can download it from tomcat apache site. You can follow this instructions to get it up and running.

    Code Block
    languagebash
    sudo apt-get install tomcat7


  15. Install mysql using the instructions specified on the mysql documentation for your platform.

    Code Block
    languagebash
    sudo apt-get install mysql-server-5.6
    #Or if you're using Ubuntu 15.10 or greater
    sudo apt-get install mysql-server


  16. Create and initialize the quartz database in

    mysql

    MySQL as follows

    :Create a user for the quartz and opensrp-web database applications

    1. Download this file tables_quartz_mysql.sql

    2. Create the quartz database by running: CREATE DATABASE motechquartz; Ensure that the user you created has permission to this database.
    3. (Optional) Create a user for quartz that only has access to the motechquartz database
    4. To create the database tables for the motechquartz database: mysql -u root -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_MOTECH_DATABASEmotechquartz" < "$PATH_TO"/tables_quartz_mysql.sql
      View file
      nametables_quartz_mysql.sql
      height250
    Update the assets
  17. (Optional) For the development environment install your preferred Java editor Eclipse, STS, NetBeans IDE, IntelliJ IDEA, etc.
    STS and IntelliJ IDEA is preferable.
    You can download STS (Spring Tools Suite) here
    You can download IntelliJ IDEA here

  18. Clone the appropriate OpenSRP Server git repository from https://github.com/OpenSRP/opensrp-server and checkout the correct branch.


    Code Block
    languagebash
    git clone https://github.com/OpenSRP/opensrp-server.git
    git checkout BRANCH_NAME


    Each implementation of OpenSRP is maintained in a distinct branch on the OpenSRP GitHub repository.
    Below is a list of branches to clone:
    1. Zambia Electronic Immunization - Branch Name: "path"
    2. TB Reach applicatoin - Branch Name: "tb-reach"
    3. mCare - Branch Name: "mcare-2"
    4. Bangladesh - Branch Name: "bd-family-planning"
    5. Indonesia - Branch Name: "indonesia-server-v2"
  19. (Optional) Import the git repository into your IDE
  20. Update the following files with password credentials (MySQL and CouchDB)
    1. assets/config/couchdb.properties
    2. assets/config/opensrp.properties
    and opensrp
    1. opensrp-web/src/main/resources/quartz.properties
    with the mysql and couchdb credentials
  21. Build the OpenSRP WAR file in your IDE or maven
    1. If using maven:
      1. Enter the openrsrp-server folder and make sure you're on the correct branch 

        Code Block
        cd opensrp-server
        git status


      2. Run mvn clean install from the root directory of opensrp-server. If there are test failures, you can run the mvn clean install -Dmaven.test.skip=true to build and install all the different modules.

  22. Once tomcat is running, you can install the opensrp.war file from opensrp-web into the webapps directory in order to run the application.

    Code Block
    languagebash
    sudo cp opensrp-web/target/opensrp.

    Here is the OpenMRS installation guide line OpenMRS Installation
    war /var/lib/tomcat7/webapps/


  23. Proceed to install OpenMRS using the OpenMRS Installation Guide