This guide will take you through the steps needed to install Firefox, Java, Tomcat, and Jetty, preparing your system for running OpenMRS.
Step 1: Install Firefox
Begin by installing Firefox, which will be necessary to access and manage OpenMRS.
Instructions:
instructions under https://support.mozilla.org/en-US/kb/install-firefox-linux
Follow thedetailed installation instructions for Linux at the following link: Install Firefox on Linux.
Step 2: Install
...
Ubuntu
You can install the OpenJDK on it's own as a package
...
Java
Java is essential for running OpenMRS, and the installation process varies depending on your operating system.
For Ubuntu:
Option 1: Install OpenJDK Directly
Code Block language bash sudo apt-get install openjdk-8-jdk
...
Option 2: Install OpenJDK as a
...
Dependency of Tomcat
Code Block language bash sudo apt-get install tomcat7
...
For Other Operating Systems:
Download Java:
Obtain the Java 8 release version of the Java Runtime Environment (JRE) from the official site.
Install Java:
Run the installer
...
or unzip the contents,
...
depending on the provided package.
Accept the license agreement to complete the installation.
Step 3: Install Tomcat
Other operating systems
...
Tomcat is the application server that will run OpenMRS. You can either install it as a package or manually from a zip archive.
Option 1: Manual Installation on Other Operating Systems
Download Tomcat:
Get the zip archive of Tomcat 7.0.99
...
Unpack the zip file to a suitable location such as /opt on Linux or /Library on Mac OSX
...
from the official website.
Unpack Tomcat:
Code Block language bash sudo useradd tomcat7 cd /opt sudo tar zxvf apache-tomcat-7.0.99.tar.gz
...
sudo ln -s apache-tomcat-7.0.99 tomcat7
...
sudo chown tomcat7.tomcat7 apache-tomcat-7.0.99
Configure Tomcat Users:
Open the Tomcat users file (e.g.,
/opt/tomcat/conf/tomcat-users.xml
)
...
as root:
Code Block language bash sudo nano /opt/tomcat/conf/tomcat-users.
...
xml
Add a user with admin and manager roles:
Code Block language xml <user name="admin" password="XXXXXX" roles="tomcat,admin,manager,manager-gui"/>
...
Run the following command from a terminal
...
Option 2: Installation as a Debian Package (Not Recommended)
Install Tomcat:
Code Block language bash sudo apt-get install tomcat7
Configure Tomcat Users:
Open the Tomcat users file (e.g.,
/etc/tomcat/tomcat-users.xml
)
...
as root:
Code Block language bash sudo nano /etc/tomcat/tomcat-users.xml
...
Add a user with admin and manager roles:
Code Block language xml <user name="admin" password="XXXXXX" roles="tomcat,admin,manager,manager-gui"/>
Adjust Security Settings:
Turn off
...
the Tomcat security flag
...
:
Code Block language bash sudo nano /etc/init.d/tomcat7
...
Find
...
TOMCAT7_SECURITY=yes
...
and change it to
...
TOMCAT7_SECURITY=no
...
.
Create OpenMRS
...
Application Data Directory:
Code Block language bash sudo mkdir /usr/share/tomcat6/.OpenMRS
...
sudo chown -R tomcat7:root /usr/share/tomcat7/.OpenMRS
...
Step 4: Install Jetty (Alternative to Tomcat)
Jetty is another application server option for running OpenMRS, particularly in a Linux environment.
...
Jetty Installation Steps
Download Jetty:
Obtain Jetty 7.4.5
...
from the official site (avoid version 7.5.4
...
Unpack the tar file to your preferred directory (I usually use /usr/share/jetty)
...
, which may have compatibility issues with your JDK).
Unpack Jetty:
Code Block language bash sudo mkdir /usr/share/jetty
...
cd /usr/share/jetty
...
sudo mv /path/to/
...
jetty/jetty-distribution-(version).tar.gz .
...
sudo tar xfz jetty-distribution-(
...
version).tar.gz
...
sudo mv jetty-distribution-(version)/* .
...
sudo rm -rf jetty-distribution(version)
Now to make it start when you start the system and make Jetty a service
Set Up Jetty as a Service:
Copy the Jetty startup script:
Code Block language bash sudo cp bin/jetty.sh /etc/init.d/jetty
Edit
/etc/init.d/jetty
to
...
define the paths for Java and Jetty:
Code Block language bash JAVA_HOME=
...
/path/to/java
...
JETTY_HOME=/usr/share/jetty
...
// or
...
your
...
Jetty installation directory
...
Start Jetty:
Place the
openmrs.war
file in
...
/usr/share/jetty/webapps/
...
.
Start Jetty using the command:
Code Block language bash sudo /etc/init.d/jetty start
Step
...
5: Install
...
Ubuntu
You can install the OpenJDK on it's own as a package
...
MySQL
Finally, you need to set up a MySQL database to store the OpenMRS application data.
For Ubuntu:
Install MySQL:
Code Block language bash sudo apt-get install mysql-server
Set a Root Password:
During installation, you will be prompted to enter a root password. Remember this for configuring OpenMRS.