...
JDK 1.7 or above (1.8 is recommended)
Development Editor
CouchDB 1.6.1 - port :5984. (Remember to put properties file, bean id and configure in appcontext of spring); /start couchDB
PostgresSQL 9.1 or above (Install as a service since its only used for reporting) - Port: 5432; /start postgres windows service
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
- Mysql 5.6 or above (This is required by the Quartz plugin and opensrp-web)
- Maven 2 or above
Apache-Tomcat 6 or above (Tomcat 7 is recommended)
OpenMRS version 1.12.x
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).
To install OpenJDK run the following command from terminal:
Code Block language bash sudo apt-get install openjdk-7-jdk
- After
- installing Java, set the JAVA_HOME variable - you will need this later in the set up so be sure to set it correctly.
First find out the path of your Java Installation
Code Block language bash sudo update-alternatives --config java
It should return something like this:No Format nopanel true There are 2 choices for the alternative java (providing /usr/bin/java).
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:
Copy your installed Java path and put it into file /etc/environment
Code Block language bash 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-7-openjdk-amd64/
There's no need to include /jre/bin/java)
- JAVA_HOME="YOUR _PATH"
- JAVA_HOME="YOUR _PATH"
Reload this file
Code Block language bash source /etc/environment
Test it by executing
Code Block language bash echo $JAVA_HOME
If you have set it correctly, your path should now show on screen (ie. /usr/lib/jvm/java-7-openjdk-amd64
You can download STS (Spring Tools Suite) here
You can download IntelliJ IDEA hereClone 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/)
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 language bash 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.
- To use
(Optional) The OpenSRP reporting module
it needs to installand 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.To install PostgreSQL execute the
following commands
Code Block language bash sudo apt-get update
sudo apt-get install postgresql postgresql-contrib
Connect to the default database with user postgres
Code Block language bash sudo -u postgres psql template1
Set the password for user postgres, then exit psql (Ctrl-D)
Code Block language bash ALTER USER postgres with encrypted password 'xxxxxxx';
Edit the
pg_hba.conf
file
Code Block language bash sudo vi /etc/postgresql/9.1/main/pg_hba.conf
And change "peer" to "md5" on the line concerningpostgres
local all postgrespeermd5
Restart the database
Code Block language bash sudo /etc/init.d/postgresql restart
Whenpostgresqlservice stops use the command to start
Code Block language bash sudo service postgresql start
We use Apache ActiveMQ for scheduling activities on the server side (JMS, Quartz, Motech, etc.
install we will need to install Apache ActiveMQ )
- To install Apache ActiveMQ download
it - the latest stable release from Apache ActiveMQ Site
Extract
your download to your preferred folder, for example /home/apache-activemq or move it to /opt where optional software package are intended to be placedthe download to /opt
Code Block language bash sudo tar -xf apache-activemq-x.x.x
/bin/linux-x86-64/wrapper.conf-bin.tar.gz -C /opt/
To create an ActiveMQ service, create a soft link in init.d using the following command:
Code Block language bash sudo ln -
s 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
- Verify it's running by checking the following url:
http://localhost:8161/
fileserver/Install Maven 2 or above. To install from terminal execute the command:following command
mavenCode Block language bash sudo apt-get install
Runmvn 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-tomcatmaven
Install tomcat7 you can download it from tomcat apache site. You can follow this instructions to get it up and running.
Code Block language bash sudo apt-get install tomcat7
Install mysql using the instructions specified on the mysql documentation for your platform.
Code Block language bash sudo apt-get install mysql-server-5.6 #Or if you're using Ubuntu 15.10 or greater sudo apt-get install mysql-server
Create and initialize the quartz database in
mysqlMySQL as follows
:Create a user for the quartz and opensrp-web database applicationsDownload this file tables_quartz_mysql.sql
- Create the quartz database by running: CREATE DATABASE motechquartz; Ensure that the user you created has permission to this database.
- (Optional) Create a user for quartz that only has access to the motechquartz database
- 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 name tables_quartz_mysql.sql height 250
(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 hereClone the appropriate OpenSRP Server git repository from https://github.com/OpenSRP/opensrp-server and checkout the correct branch.
Code Block language bash 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:- Zambia Electronic Immunization - Branch Name: "path"
- TB Reach applicatoin - Branch Name: "tb-reach"
- mCare - Branch Name: "mcare-2"
- Bangladesh - Branch Name: "bd-family-planning"
- Indonesia - Branch Name: "indonesia-server-v2"
- (Optional) Import the git repository into your IDE
- Update the following files with password credentials (MySQL and CouchDB)
- assets/config/couchdb.properties
- assets/config/opensrp.properties
- opensrp-web/src/main/resources/quartz.properties
- Build the OpenSRP WAR file in your IDE or maven
- If using maven:
Enter the openrsrp-server folder and make sure you're on the correct branch
Code Block cd opensrp-server git status
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.
- If using maven:
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 language bash sudo cp opensrp-web/target/opensrp.
Here is the OpenMRS installation guide line OpenMRS Installationwar /var/lib/tomcat7/webapps/
- Proceed to install OpenMRS using the OpenMRS Installation Guide
sudo mv apache-activemq-x.x.x /opt
Add some configuration to wrapper.conf file by the commandsudo vi /opt/
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.xsudo service activemq start
To be ensured check the following urls