UgandaEMR User Manual
  • Introduction
  • Terminologies
  • System Setup and Configuration
    • UgandaEMR 1.x Installation
    • UgandaEMR 2.x Installation
    • UgandaEMR 3.x Installation
    • Linux Installation
    • Post-installation Configuration
  • Backup and Restoration
    • Linux backup
  • Upgrading UgandaEMR
    • Trouble Shooting
  • Configuring your installation
  • Managing User Accounts
  • Provider Management
    • Creating a New Provider
    • Making an existing user a provider
  • Patient Management
    • Finding Patient
    • Patient Registration
  • Fingerprint
    • Configuration
    • Search by Patient Fingerprint
    • Add Patient Fingerprint
  • Entering Client Information
    • HIV Testing Services Client Card
    • ART Card
    • HIV Exposed Infant Card
    • HIV Counseling and Testing Client Card
    • Maternal and Child Health Cards
    • Safe Male Circumcision
    • Outpatient Form
  • Reporting
    • UgandaEMR Reports
    • Cohort Builder
    • Data Export
    • Sending Report to DHIS2
    • Sending Metrics Report
    • Audit tool Reports
    • Troubleshooting Report Tips
  • Data Quality Checks
  • Patient Provider Notifications
    • Configurations
    • Message Customization
    • Patient Enrollment
    • Patient De-registration
  • Patient Flags
  • Program Workflows
    • Differentiated Service Delivery Models (DSDM)
    • HIV Recency Testing
    • ART Regimen Lines
    • Tuberculosis
    • COVID19
  • Troubleshooting Tips
  • Uninstalling UgandaEMR
    • Unistalling UgandaEMR older versions
  • Point of Care (POC)
    • Installation and Configuration
      • Roles
    • Work Flows
      • Reception
      • Triage
      • Clinician
        • HIV Clinic
      • Laboratory
      • Pharmacy
  • Data Exchange
    • ART Access Integration
    • Viral Load Integration
    • Send Aggregate Reports
    • Patient Data Upload
      • Uploading Viral Load Results
  • UgandaEMR Mobile
    • Introduction
    • Download Patients
  • Release Notes
    • 1.0.14
    • 1.0.16
    • 1.0.17
    • 2.0.0
    • 2.1.0
    • 3.0.0
    • 3.0.4
    • 3.1.0
    • 3.1.3
    • 3.2.0
    • 3.3.0
    • 3.3.7
    • 3.4.1
Powered by GitBook
On this page
  • Software Requirements for UgandaEMR
  • Installation of Java
  • Installation of Tomcat
  • Mysql 5.6 Installation
  • Deploying UgandaEMR on Linux

Was this helpful?

  1. System Setup and Configuration

Linux Installation

PreviousUgandaEMR 3.x InstallationNextPost-installation Configuration

Last updated 1 year ago

Was this helpful?

Software Requirements for UgandaEMR

- Java JDK 8 
- Tomcat 7 or higher
- Mysql 5.6 or 5.7

Installation of Java

  1. Login as root in the linux environment

  2. Download the JDK 8(jdk-8u361-linux-x64.tar.gz) from this official site:

  3. Open the terminal and enter the following command to create the parent directory to deploy the JDK. sudo mkdir /usr/lib/jvm

  4. Enter the following command to change the directory cd /usr/lib/jvm

  5. Extract the jdk-8u361-linux-x64.tar.gz file in the jvm directory using this command

    sudo tar -xvzf /YourHomeDirectory/jdk-8u361-linux-x64.tar.gz

  6. Enter the following command to open the environment variables file. According to your personal preference, you can choose any text editor instead of nano. sudo nano /etc/environment

  7. In the opened file, add the following bin folders to the existing PATH variable. Note that the PATH variables must be separated by a colon.

    /usr/lib/jvm/jdk1.8.0_361/bin

    /usr/lib/jvm/jdk1.8.0_361/db/bin

    /usr/lib/jvm/jdk1.8.0_361/jre/bin

    Append the following environment variable to the end of the file.

    J2SDKDIR="/usr/lib/jvm/jdk1.8.0_361" 
    
    J2REDIR="/usr/lib/jvm/jdk1.8.0_361/jre"
    
    JAVA_HOME="/usr/lib/jvm/jdk1.8.0_361"

    A sample environment file before making these changes would look like the following:

     PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"

    The same file after making the changes should look like this:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:
    /usr/lib/jvm/jdk1.8.0_361/bin:/usr/lib/jvm/jdk1.8.0_361/db/bin:/usr/lib/jvm/jdk1.8.0_361/jre/bin"
    
    J2SDKDIR="/usr/lib/jvm/jdk1.8.0_361"
    
    J2REDIR="/usr/lib/jvm/jdk1.8.0_361/jre"
    
    JAVA_HOME="/usr/lib/jvm/jdk1.8.0_361"
  8. Save the changes and close the editor

  9. Sometimes an existing JDK installation might have a shortcut added to the /usr/bin directory. Therefore setting the PATH environment variable alone may not change the default Java compiler and runtime. To update these alternative shortcuts, run the following commands:

    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_351/bin/java" 0sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_351/bin/javac" 0sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_351/bin/java

    sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_351/bin/javac

  10. To verify the setup enter the following commands and make sure that they print the location of java and javac as you have provided in the previous step.

    update-alternatives --list java

    update-alternatives --list javac

  11. Test version on terminal with command

  12. java -version

  13. If you are not able to see the version install missing linux libraries

    sudo apt-get install libc6-i386

Installation of Tomcat

Tomcat installation will require java which were previously installed as shown above

  1. sudo apt update

  2. Set up a Tomcat user sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat

  3. Download tomcat

wget -c https://archive.apache.org/dist/tomcat/tomcat-7/v7.0.109/bin/apache-tomcat-7.0.109.tar.gz 4. Install on linux sudo tar xf apache-tomcat-7.0.109.tar.gz -C /opt 5. Rename apache-tomcat-7.0.109 to tomcat

cd /opt

mv apache-tomcat-7.0.109 tomcat

  1. Now we need to provide the user Tomcat with access for the Tomcat installation directory

    sudo chown -R tomcat: /opt/tomcat/*

  2. Finally, we will use the chmod command to provide all executable flags to all scripts within the bin directory.

    sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'

  3. Configure Tomcat serice sudo nano /etc/systemd/system/tomcat.service

    Now enter the following in your file and save it. Note that you need to update the value of JAVA_HOME if your Java installation directory is not the same as given below.


    [Unit]
    Description=Apache Tomcat Web Application Container
    After=network.target
   
    [Service]
    Type=forking
      
    Environment="JAVA_HOME=/usr/lib/jvm/jdk1.8.0_361"
    Environment="CATALINA_PID=/opt/tomcat/temp/tomcat.pid"
    Environment="CATALINA_HOME=/opt/tomcat/"
    Environment="CATALINA_BASE=/opt/tomcat/"
    Environment="CATALINA_OPTS=-Xms1024M -Xmx2048M -server -XX:+UseParallelGC"
    Environment="JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom"
      
    ExecStart=/opt/tomcat/bin/startup.sh
    ExecStop=/opt/tomcat/bin/shutdown.sh
      
    User=tomcat
    Group=tomcat
    UMask=0007
    RestartSec=10
    Restart=always
      
    [Install]
    WantedBy=multi-user.target
  1. Now we reload the daemon to update the system about the new file.

    sudo systemctl daemon-reload

  2. Start tomcat service sudo systemctl start tomcat

  3. Now we can enable the Tomcat service to run on startup using this command. sudo systemctl enable tomcat

  4. After you install Tomcat, you need to allow it to use the 8080 port through the firewall to be able to communicate outside your local network. sudo ufw allow 8080/tcp

  5. Once we install Tomcat on Linux, we need to verify our installation. To do so, simply enter the following in your browser.

  6. http://YourIPAddress:8080

  1. To enable tomcat to write in /var/lib , create the OpenMRS folder and make tomcat to own it using the commands below

    cd /var/lib

    mkdir OpenMRS

    sudo chown tomcat:tomcat OpenMRS/*

  2. Done.

Mysql 5.6 Installation

Remember to create mysql user 'openmrs'

Deploying UgandaEMR on Linux

  1. Stop tomcat service sudo service tomcat stop

  2. copy war file to /opt/tomcat/webapps folder

  3. Start tomcat service sudo service tomcat start

  4. Access the system on browser via http://YourIPAddress:8080/openmrs

  5. You should see OpenMRS Installation Wizard page as below

  6. Select your preferred language and click the “=>” button.

  7. On the Installation Type screen, choose the Advanced installation type you want and click the “=>” button.

  8. Fill in your MySQL root password as shown below, and click the “=>” button.

  9. Fill the Next form as shown below and click the “=>” button.

  10. Fill in options as shown below and click the “=>” button.

  11. Fill in admin password as shown below and click the “=>” button.

  12. Skip next form click the “=>” button.

  13. And continue to finish the installation

  14. Drop openmrs database dump to openmrs database and restart tomcat service.

  15. Done Click the “=>” button to create a database for OpenMRS and complete the installation. Log in to OpenMRS using the default username “admin” and password “Admin123”.

If your installation and configuration were successful, you should see this page.

Guide for mysql installation is provided in link here

Mysql Installation
Intial page
Intial page
page2
page2
page3
page3