Technologies used
The technologies which are components of the Intelehealth Platform are:
a. Java: Prerequisite for Tomcat
b. Mysql
c. Tomcat7 (any other version is also fine): Prerequisite for OpenMRS, Sync Module
d. OpenMRS
e. Sync Module
f. Intelehealth UI
STEPS TO BE FOLLOWED:
1. Login remotely using your SSH client (if you are on windows use Putty, or Cygwin to use SSH client).
2. Create the sudo user [At this point, there is only one user created ubuntu]:
$ sudo adduser ihadmin [ihadmin is the username]
Use password: xxxx [This is the ssh login]
3. Transfer ownership rights to ihadmin , from Ubuntu user:
$ cp /home/ubuntu/.ssh /home/ihadmin/
Navigate to /home/ihadmin: $ chown -R ihadmin:ihadmin .ssh/
3. Set the root password, and change it using ‘Passwd’ command
New password: xxxx
Old password: xxxx
4. Assign user rights [Adding the user ihadmin to the group] :
$ usermod -aG sudo ihadmin [where ihadmin is the user name]
5. Login into the root user using the password created in step-3, before moving to step-6 below.
6. Run these commands to upgrade all packages and remove unwanted packages on
7. Install Firefox browser & Java:
You can check for the Java version installed using the following command.
8. Install Tomcat (can be done via apt-get or wget)
Via apt-get [1]
Via wget [2]
a. Create a directory for tomcat installation
b. Check the tomcat page for the links where you can download the file
c. Unzip the file and run startup.sh file to complete the installation
You can access the tomcat page by opening the web-browser. A message will show “it works!”
http://server_IP_address:8080
9. Configuring Tomcat
a. Making changes to Java options Tomcat uses
b. Find the JAVA_OPTS
line and replace it with the following. Feel free to change the Xmx
and MaxPermSize
values—these settings affect how much memory Tomcat will use:
c. Install additional modules [optional]
d. Configure web-management interface [3]
In order to use the manager webapp installed in Step 3, we must add a login to our Tomcat server. We will do this by editing the
tomcat-users.xml
file
In order to add a user who can access the
manager-gui
andadmin-gui
(the management interface that we installed in Step Three). You can do so by defining a user similar to the example below. Be sure to change the username and password to something secure
Save and quit the tomcat-users.xml file. To put our changes into effect, restart the Tomcat service:
On accessing the web-interface, using the IP address as used above, the following message is displayed.
10. Install Mysql [4]:
11. Create OpenMRS folder inside Tomcat and provide necessary permissions:
12. Download OpenMRS & Reference modules [Use the version as per your requirement]
13. Unzip OpenMRS inside the webapps folder of Tomcat already installed
14. Provide necessary permissions for openMRS:
chown -R tomcat7:tomcat7 /var/lib/tomcat7/webapps/openmrs
15. Deploy the war file by opening the IP on a browser
You will see the set-up screen. Follow all the steps using typical installation, provide access to the database credentials and complete the installation.
After completing initial steps and installation, you will see in the screen that Platform 2.05 is successfully installed, but it will need some reference module which will help to run your company's UI.
16. Put reference modules in the modules folder:
17. Provide the necessary permissions for the modules:
18. Load the mysql dump file with table structures
a. Create a database openmrs by logging into mysql
b. Copy the dump file onto the server, using SFTP
c. Load the dump file onto the database using the following command
Dump file that needs to be used:
19. Sync Module set-up
a. Unzip the “EMR-Middleware”(Sync Module) war file as given below
b. The unzipped war file needs to be copied inside the /var/lib/tomcat/webapps folder
c. Open tomcat7 on the browser with the port8080 and open the index html file. It should say “Hello world”
e.g. http://demo.intelehealth.io:8080/EMR-Middleware/index.html [Here, EMR-Middleware is the name of
the file]
d. You can also deploy the war file, by going inside the manager web-admin of tomcat and click deploy.
Note: You can check for the get and post requests of all the patient data in the dump database on the server
19. Load the Intelehealth UI onto the folder, and with that you have successfully set-up all the relevant modules of the platform.
20. Redirecting ports on Ubuntu server using IP Tables
a. Redirecting port 80, 443 on Ubuntu Server using iptables. you have to run the web application on a port 8080. The user accesses to your website via port 80, and it will be redirected to port 8080. The redirection is carried out by OS. To redirect it, you need to configure iptables. Please Click_Here for more details
http://demo.intelehealth.io:8080/openmrs (Address is not friendly)
http://demo.intelehealth.io/openmrs (Address is friendly).
Firstly, you need to check application running and port used. $ netstat -ntl
. Since Tomcat is running on port 8080, Command to redirect port 80 traffic to port 8080
$ sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
$ sudo iptables -t nat -L
[to verify if they are working fine]
b. Next, you have to save the configuration information above to make sure that it is still useful when you restart the OS.
Select YES for IPv4 & IPv6 to apply access.
If you want to remove redirecting 80 to 8080 as above, you need run the following command:
21. Redirecting the OpenMRS path
After putting the domain name, we have to define the openmrs path as /openmrs to run the OpenMRS. But we have to redirect openmrs as a default page for Tomcat. After this openmrs will be redirect as default page to domain. Previously http://demo.intelehealth.io/openmrs will open First login page.
a. Run the following commands
b. Paste these line of code to openmrs_tomcat_redirect.html file
c. Run the following commands to provide permissions and make changes to web.xml file
d. Locate welcome file list " <welcome-file-list> " and replace <welcome-file>index.html</welcome-file> to
<welcome-file>openmrs_tomcat_redirect.html</welcome-file>
e. Now, restart tomcat. OpenMRS will run as default page for tomcat. http://demo.intelehealth.io .
Note:
In case you wish to access the server using winscp for the sudo user to transfer files via SFTP, you can do that using the following [5].
a. Open the Winscp portal for login and enter the user credentials
b. Click ‘Edit’ and go to ‘Advanced Settings’. Provide the SSH key and make the following changes
SFTP: sudo /usr/lib/openssh/sftp-server
Shell: sudo -s