OpenSRP Server Build

OpenSRP is an open source project that uses multiple platforms.  

For a full server build you will need to install the technology components/programs to install OpenSRP.

  1. JDK 1.8 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. CouchDB Lucene 1.1
  5. PostgresSQL 10.2 or above (Install as a service since its only used for reporting) - Port: 5432; /start postgres windows service

  6. 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

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

  10. OpenMRS version 1.12.x or OpenMRS version 2

Debian Linux Installation

  1. You will need to Install jdk1.8 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 commands from terminal:

      sudo add-apt-repository ppa:webupd8team/java
      sudo apt-get update   
      sudo apt-get install openjdk-8-jdk
    2. After installing Java, set the JAVA_HOME variable - you will need this later in the set up so be sure to set it correctly.
      1. First find out the path of your Java Installation

        sudo update-alternatives --config java


        It should return something like this:

        There are 2 choices for the alternative java (providing /usr/bin/java).
        Selection    Path                                            Priority   Status
        ------------------------------------------------------------
        * 0            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1062      auto mode
          1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1061      manual mode
          2            /usr/lib/jvm/java-8-oracle/jre/bin/java          1062      manual mode
        
        Press enter to keep the current choice[*], or type selection number:
      2. Copy your installed Java path and put it into file /etc/environment

        sudo nano /etc/environment

        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-8-openjdk-amd64/ There's no need to include /jre/bin/java) 

        JAVA_HOME="YOUR _PATH"

      3. Reload this file

        source /etc/environment

        Test it by executing

        echo $JAVA_HOME

        If you have set it correctly, your path should now show on screen (ie. /usr/lib/jvm/java-8-openjdk-amd64/)

  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). 

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

    For  ubuntu 18.04 use the following installation method

    sudo apt-get install curl
    curl -L https://couchdb.apache.org/repo/bintray-pubkey.asc \
        | sudo apt-key add -
    
    echo "deb https://apache.bintray.com/couchdb-deb bionic main" \ | sudo tee -a /etc/apt/sources.list.d/apache_couchdb_bionic.list
    sudo apt-get update
    sudo apt-get install apache2 couchdb

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

  3. Install PostgreSQL 10.2 or above.

    1. To install PostgreSQL execute the following commands

      sudo apt-get update
      sudo apt-get install postgresql postgresql-contrib
    2. Connect to the default database with user postgres

      sudo -u postgres psql template1
    3. Set the password for user postgres, then exit psql (Ctrl-D)

      ALTER USER postgres with encrypted password 'xxxxxxx';
    4. Edit the pg_hba.conf file

      sudo vi /etc/postgresql/10.2/main/pg_hba.conf
    5. And change "peer" to "md5" on the line concerningpostgres
      local all postgres peer md5

    6. Restart the database

      sudo /etc/init.d/postgresql restart
    7. Whenpostgresqlservice stops use the command to start

      sudo service postgresql start
  4. We use Apache ActiveMQ for scheduling activities on the server side (JMS, Quartz, Motech, etc.)

    1. To install Apache ActiveMQ download the latest stable release from Apache ActiveMQ Site 
    2. Extract the download to /opt

      sudo tar -xf apache-activemq-x.x.x-bin.tar.gz -C /opt/
    3. To create an ActiveMQ service, create a soft link in init.d using the following command:

      sudo ln -snf /opt/apache-activemq-x.x.x/bin/linux-x86-64/activemq /etc/init.d/activemq
      sudo update-rc.d activemq start 66 3 5 . stop 34 0 1 6 .
      sudo service activemq start
    4. Verify it's running by checking the following url:
      http://localhost:8161/
  5. Install Maven 2 or above. To install from terminal execute the following command

    sudo apt-get install maven
  6. Install tomcat7 you can download it from tomcat apache site. You can follow this instructions to get it up and running.

    sudo apt-get install tomcat7
  7. Install mysql using the instructions specified on the mysql documentation for your platform.

    1. For most Debian versions we recommend MySQL 5.6

      sudo apt-get install mysql-server-5.6
      #If you're using Ubuntu 15.10 or greater
      sudo apt-get install mysql-server
      
      #For those using ubuntu 18.04 and greater, use maria-db instead of Mysql
    2. If you are using Ubuntu 18.04 or greater, use Maria DB 10.3 is recommended

      #install software-properties-common
      sudo apt-get install software-properties-common
      
      #Import gpg key
      sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
      
      #add the repo. 
      sudo add-apt-repository 'deb [arch=amd64] http://mirror.zol.co.zw/mariadb/repo/10.3/ubuntu bionic main'
      
      #install Maria DB 
      sudo apt update
      sudo apt -y install mariadb-server mariadb-client
      
      #you can select your setting for the next set of instructions
  8. Create and initialize the quartz database in MySQL as follows

    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" "motechquartz" < "$PATH_TO"/tables_quartz_mysql.sql
  9. Install CouchDB Lucene v1.1
    1. Download the source code and unpack the tarball (https://github.com/rnewson/couchdb-lucene/releases/tag/v1.1.0)

      tar -xzf couchdb-lucene-1.1.0.tar.gz -C ~/
    2. Enter the directory

      cd ~/couchdb-lucene-1.1.0/
    3. Build the project with maven

      mvn install
    4. Run maven

      mvn
    5. Unzip the build file and install it in the /opt/ directory

      sudo tar -xzf target/couchdb-lucene-1.1.0-dist.tar.gz -C /opt/
    6. Rename the distribution folder

      sudo mv /opt/couchdb-lucene-1.1.0 /opt/couchdb-lucene
  10. Configure CouchDB to work with Lucene
    1. Edit the local.ini file

      sudo nano /opt/couchdb/etc/local.ini
    2. Add the following line under the [httpd_global_handlers]
      _fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985">>}
    3. Enter into directory by the command  cd /opt/couchdb-lucene/tools/etc/init.d/couchdb-lucene/
    4. Edit the couchdb-lucene file as DAEMON=/opt/couchdb-lucene/bin/run for your application directory path.
    5. If you have set your admin user in couchdb Navigate to /opt/couchdb-lucene/conf/ then Edit the couchdb-lucene.ini and edit the last code url = http://localhost:5984/ with url = http://youradminuser:youradminpass@localhost:5984/
    6. Navigate to /opt/couchdb-lucene/tools/etc/init.d/couchdb-lucene/
    7. After saving run the command in the terminal cp couchdb-lucene /etc/init.d/
    8. Restart couchdb service to fall your change effect executing the command sudo service couchdb restart
    9. Start the couchdb-lucene service executing the command sudo service couchdb-lucene start to create the Channel with couchdb server
  11. Installing Redis
    1. Install necessary tools to compile redis and dowload the latest version of stable redis 

      #update your repo
      sudo apt-get update
      
      #download a compiler with build essentials
      sudo apt-get install build-essential 
      
      #download tcl language
      sudo apt-get install tcl8.5
      
      #download the latest stable redis
      wget http://download.redis.io/releases/redis-stable.tar.gz
      
      #untar the package
      tar xzf redis-stable.tar.gz
      
    2. Compile and build REDIS Server

      #switch to the directory
      cd redis-stable
      
      #elevate your terminal user and type in your password
      sudo su
      
      #run the following tcl commands to compile and install 
      #build
      make
      #run tests to ensure there are no errors. Pay attention to any errors shown on screen and resolve
      make test
      #install
      make install
    3. Run Configuration of Redis, you can use the default options if you like
      #Redis comes with default configuration files in the util directory
      cd utils
      sudo ./install_server.sh
      
      #assuming you used the default options, start redis by using the commands
      sudo service redis_6379 start
      sudo service redis_6379 stop
      
      #test your redis server by using the command below to start the command line
      redis-cli
      	#you can quit the cli by typing 
      	quit
    4. Configure automatic startup on boot

      sudo update-rc.d redis_6379 defaults
    5. Secure your new Redis server

      # ensure that the server is only bound to local host ip and has a pssword
      	#open the config file using your preferred editor
      	sudo nano /etc/redis/6379.conf
      
      	#locate the line 'bind 127.0.0.1' if its commented with a hash sign remove it
      	bind 127.0.0.1
      
      	# add a password to your redis server. Locate the line '#requirepass foobared'
      	# remove the # and change 'foobared' to your new password
      	requirepass foobared
      	
      #restart the server and test the new password
      sudo service redis-server restart
  12. (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

  13. We changed the way we build the server after our refactor and clean up work

    1. After Server Refactor and Cleanup (Recommended)

      1. Checkout Server Web Build on how to build the generic web application

      2. Checkout OpenSRP Server Refactor and Clean up for more information
    2. Before Server Refactor and Cleanup

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

        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"
      2. (Optional) Import the git repository into your IDE
      3. Update the following files with password credentials (MySQL, PostgreSQL and CouchDB)
        1. assets/config/couchdb.properties
        2. assets/config/opensrp.properties
        3. opensrp-web/src/main/resources/quartz.properties
        4. opensrp-web/src/main/webapp/META-INF/context.xml
        5. assets/migrations/environments/development.properties
      4. 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 

            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.

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

        sudo cp opensrp-web/target/opensrp.war /var/lib/tomcat7/webapps/
  14. Proceed to install OpenMRS using the OpenMRS Installation Guide

Windows Installation

  1. You will need to download java jdk1.8 to run the application.  
    •  Follow up the following steps to setup java jdk.   
  2. Download and install any development environment of your choice ie, Netbeans, eclipse or Intellij IDE (All can be used however Intellij IDEA 3.0 window's version is recommended). 
  3. Download and install Tomcat 7 to be used as an OpenSRP server.
  4. Download MySQL database from here and follow up these steps to set it up.
  5.  Install CouchDB v 1.6.1.
    • To install CouchDB, download the above release from CouchDB Relax site.
    • Double click on the downloaded software to begin the installation process.
    • Next on “Welcome” screen
    • Accept the License agreement
    • Select the installation directory
    • Specify “Start Menu” group name
    • Approve that you’d like to install CouchDB as service and let it be started automatically after installation (probably, you’d like so)
    • Verify installation settings
    • Install CouchDB
    • Open up Fauxton (if you hadn’t selected autostart CouchDB after installation, you have to start it first manually)
    • It’s time to Relax!   CouchDB v 1.6.1 is required for data storage. 
  6. Install ActiveMQ to be used for scheduling activities on the server side (JMS, Quartz, Motech, etc.).   
    • To install ActiveMQ, download the latest release from the Apache ActiveMQ site.
    • Copy the downloaded folder to any directory of your choice eg (E:\apache-activemq-5.15.2-bin).
    • Click on the bin folder and select the windows bit version you are running.
    • Open and run the Command prompt as Administrator.

    • Put in the following lines of code depending on where you placed the Apache ActiveMQ folder.

      CMD
      C:\windows:\system32\cd\
      C:\>cd Programs
      C:\>cd Programs:\apache-activemq-5.15.2-bin
      C:\>cd Programs:\apache-activemq-5.15.2-bin\cd bin
      C:\>cd Programs:\apache-activemq-5.15.2-bin\bin\cd win64
      C:\>cd Programs:\apache-activemq-5.15.2-bin\bin\win64\InstallService.bat
  7. (Optional) Download and install postgresSQL 10.2 or above for  OpenSRP reporting module and ETL processes.
  8. Create and initialize the quartz database in MySQL as follows

    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
  9. We changed the way we build the server after our refactor and clean up work

    1. After Server Refactor and Cleanup (Recommended)

      1. Checkout Server Web Build on how to build the generic web application

      2. Checkout OpenSRP Server Refactor and Clean up for more information
    2. Before Server Refactor and Cleanup
      1. Clone the appropriate OpenSRP Server git repository from https://github.com/OpenSRP/opensrp-server and checkout the correct branch,this can be done through your respective IDEs. 
      2. Update the following files with password credentials of MySQL, CouchDB, PostgreSQL and ActiveMQ respectively:
        1. comment out the CURL command in the pom.xml file for windows installation.
        2. assets/config/opensrp.properties for CouchDB and MySQL credentials
        3. opensrp-web/src/main/resources/quartz.properties for  MySQL credentials
        4. assets/config/couchdb.properties CouchDB credentials
        5. opensrp-web/src/main/webapp/META-INF/context.xml PostgreSQL credentials
        6. assets/migrations/environments/development.properties PostgreSQL credentials
      3. Run and build the OpenSRP WAR file in your respective IDE by running  the following command;
      4. In the IDE's command line terminal, type in the following command:

        code
        mvn clean install
      5. If the code generates multiples errors, type in the command bellow to build and install all the different modules.

        code Block
        mvn clean install -Dmaven.test.skip=true
  10. Generate the OpenSRP war file from the project directory under the webapps target folder.
    1. Place the downloaded war file into the tomcat folder directory.
    2. Start tomcat server.
    3. Once tomcat is up and running, place http://localhost:8080/openmrs in your respective browsers depending on the port numbers you specified while installing tomcat
    4. follow up the installation initial setup of openmrs to run it according to your desire as well as setting up its MySQL databaseDownload the Openmrs.war file version 1.11.9 from here and follow the installation procedures bellow. 
  11. Once openmrs is installed, place the generated opensrp.war into the same tomcat folder as that of openmrs.war  and start tomcat once again
  12. Open up the openMRS once again and add the following modules to enable you create users for the openSRP mobile application:
    1. Team module-1.2.2.omod
    2. reporting-1.15.0.omod
    3. UI framework-3.13.0.omod
    4. serialisation.xstream-0.2.12.omod
  13. Create a team indicating its location and other required credentials. With in the created team, add members who will be granted access to the opensrp App. 
  14. To test whether the user created is authenticated, write http://localhost:8080/opensrp/security/authenticate into your browser and place in the created user credentials. For verification, a JSON file should be returned indicating the user's details.


Mac Installation

For mac installation more or less will be similar with linux 

  1. You will need to Install jdk1.8 to run the application.

    1. Download archive jdk1.8 from https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

    2. Chose Mac OS X x64 to download 
    3. After download finished, double click the dmg file and continue with the installation
    4. If you have multiple jdk installed you can configure your ~/.bash_profile to use jdk1.8. Edit your ~/.bash_profile and add these lines:

      export JAVA_7_HOME=$(/usr/libexec/java_home -v1.7)
      export JAVA_8_HOME=$(/usr/libexec/java_home -v1.8)
      export JAVA_9_HOME=$(/usr/libexec/java_home -v9)
      alias java7='export JAVA_HOME=$JAVA_7_HOME'
      alias java8='export JAVA_HOME=$JAVA_8_HOME'
      alias java9='export JAVA_HOME=$JAVA_9_HOME'
      export JAVA_HOME=$JAVA_9_HOME
  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). 
    1. Install erlang if you dont have erlang installed, download it from https://packages.erlang-solutions.com/os-x-installer/ErlangInstaller0.9.1.dmg
    2. Download CouchDB 1.6.1 from https://archive.apache.org/dist/couchdb/source/1.6.1/apache-couchdb-1.6.1.tar.gz
    3. Extract  apache-couchdb-1.6.1.tar.gz

    4. Go into extraction folder 

    5. Follow instruction on INSTALL file:
      1. Run command line ./configure
      2. Run command line make
      3. Run command line make install
    6. Load your couchdb on startup

      sudo launchctl load /Library/LaunchDaemons/org.apache.couchdb.plist
  3. Install PostgreSQL (source: https://postgresapp.com/)

    1. Download PostgreSQL app from https://postgresapp.com/ (exp: https://github.com/PostgresApp/PostgresApp/releases/download/v2.1.4/Postgres-2.1.4.dmg)
    2. Execute the dmg file
    3. Go to your launch pad and run Postgres App
    4. Run the server from Postgres App
    5. Open your terminal and run

      sudo mkdir -p /etc/paths.d && echo /Applications/Postgres.app/Contents/Versions/latest/bin | sudo tee /etc/paths.d/postgresapp
    6. Manually access server through terminal command psql

    7. Then create user opensrp

      CREATE USER opensrp_admin WITH
        LOGIN
        SUPERUSER
        INHERIT
        CREATEDB
        CREATEROLE
        ENCRYPTED PASSWORD 'admin'
        NOREPLICATION;
    8. Then create database opensrp

      CREATE DATABASE opensrp
          WITH 
          OWNER = opensrp_admin
          ENCODING = 'UTF8'
          TABLESPACE = pg_default
          CONNECTION LIMIT = -1;
    9. Restart PostgreSQL by stop and start from Postgres App

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

    1. To install Apache ActiveMQ download the latest stable release from http://activemq.apache.org/download.html
    2. Open your terminal and create folder activemq.

      cd /Applications/ && sudo mkdir ActiveMQ
    3. Extract the download file to /Applications/ActiveMQ

    4. Open your ~/.bash_profile then add line alias activemq="/Applications/ActiveMQ/apache-activemq-5.15.4/bin/activemq"
    5. Open new terminal and start your activemq server activemq start
    6. Verify it's running by checking the following url:
      http://localhost:8161/
  5. Install Maven 2 or above.

    1. Download maven from http://maven.apache.org/download.cgi

    2. Open your terminal and create folder Maven.

      cd /Applications/ && sudo mkdir Maven
    3. Extract the download file to /Applications/Maven

    4. Open your ~/.bash_profile then add line export PATH=/Applications/Maven/apache-maven-3.5.3/bin:${PATH}
    5. Open new terminal and see if your maven installed mvn -version
  6. Install tomcat7

    1. you can download it from http://tomcat.apache.org/. Let say you download Tomcat 8.0.53: https://tomcat.apache.org/download-80.cgi

    2. Open your terminal and create folder Tomcat.

      cd /Applications/ && sudo mkdir Tomcat
    3. Extract the download file to /Applications/Tomcat

    4. Open your ~/.bash_profile then add line 

      tomcat(){
              if [ $1 ]; then
                      /Applications/Tomcat/apache-tomcat-8.0.53/bin/$1.sh
              fi
      }
    5. Open new terminal and start tomcat by using tomcat startup

    6. You can run sh file inside /Applications/Tomcat/apache-tomcat-8.0.53/bin/ by using command tomcat xxxxxxx
  7. Install mysql

    1. You can follow the instruction from https://dev.mysql.com/doc/refman/5.6/en/osx-installation-pkg.html

    2. To make your work easier, you can install mysql workbench from https://dev.mysql.com/doc/workbench/en/wb-installing-mac.html

  8. Create and initialize the quartz database in MySQL as follows

    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" "motechquartz" < "$PATH_TO"/tables_quartz_mysql.sql
  9. Install CouchDB Lucene v1.1 (https://github.com/rnewson/couchdb-lucene)
    1. Download the source code and unpack the tarball (https://github.com/rnewson/couchdb-lucene/releases/tag/v1.1.0)

      tar -xzf couchdb-lucene-1.1.0.tar.gz -C ~/
    2. Enter the directory

      cd ~/couchdb-lucene-1.1.0/
    3. Build the project with maven

      mvn install
    4. Run maven

      mvn
    5. Unzip the build file and install it in the /opt/ directory

      sudo tar -xzf target/couchdb-lucene-1.1.0-dist.tar.gz -C /opt/
    6. Rename the distribution folder

      sudo mv /opt/couchdb-lucene-1.1.0 /opt/couchdb-lucene
  10. Configure CouchDB to work with Lucene
    1. Edit the local.ini file

      sudo nano ~/Library/Preferences/couchdb2-local.ini
    2. Add the following line

      [httpd_global_handlers]
      _fti = {couch_httpd_proxy, handle_proxy_req, <<"http://127.0.0.1:5985">>}
    3. Open your ~/.bash_profile then add line alias couchdb-lucene="/opt/couchdb-lucene/bin/run"
    4. If you have set your admin user in couchdb Navigate to /opt/couchdb-lucene/conf/ then Edit the couchdb-lucene.ini and edit the last code url = http://localhost:5984/ with url = http://youradminuser:youradminpass@localhost:5984/
    5. Restart couchdb service to fall your change effect executing the command 

      sudo launchctl stop org.apache.couchdb &&
      sudo launchctl start org.apache.couchdb
    6. Open new terminal and run couchdb-lucene

  11. (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

  12. We changed the way we build the server after our refactor and clean up work

    1. After Server Refactor and Cleanup (Recommended)

      1. Checkout Server Web Build on how to build the generic web application

      2. Checkout OpenSRP Server Refactor and Clean up for more information
    2. Before Server Refactor and Cleanup
      1. Clone the appropriate OpenSRP Server git repository from https://github.com/OpenSRP/opensrp-server and checkout the correct branch.

        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"
      2. (Optional) Import the git repository into your IDE
      3. Update the following files with password credentials (MySQL, PostgreSQL and CouchDB)
        1. assets/config/couchdb.properties
        2. assets/config/opensrp.properties
        3. opensrp-web/src/main/resources/quartz.properties
        4. opensrp-web/src/main/webapp/META-INF/context.xml PostgreSQL credentials
        5. assets/migrations/environments/development.properties PostgreSQL credentials
      4. 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 

            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.

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

        sudo cp opensrp-web/target/opensrp.war /Applications/Tomcat/apache-tomcat-x.x.xx/webapps/
  13. Proceed to install OpenMRS using the OpenMRS Installation Guide

Related pages