v2.0 Implementation Documentation

Hello All,

With the recent release of platform 2.0 it may be time to redo the installation documentation. Don’t worry (as most developer hate doing doco) I am happy to type it all up.

When deploying OpenMRS there are a number of different documentation sources and this can be quite confusing to many people that are new to OpenMRS.

I am able to get my installations running eventually (I do a bit of macgyvering and it all comes together eventually) as I have some reasonable Linux skills, but I am sure that there are better quicker ways to get an install going. Often there is a lot of Yak shaving to get it to work. I would lie to develop a good set of instructions to do this.

I’d appreciate a bit of a hand of a to get this together as I am sure that my way is not often the best way.

Regards

Oliebolz

Hello all, So moving on … If you take the standard Sys Admin, he is going to fire up a Linux server and crack on with getting a “Dev” system up and running straight away. Basically get Tomcat, Mysql and Java set up try to drop in the .WAR and away they go. [I am aware that the ‘stand alone’ version has a Java and script for this but if they fail because of environmentals then it is good to show people how to do it all by hand] But its not that simple - such as the current .WAR is larger than the Tomcat default (> 50Mb), and so on. So here is the first thoughts on the cook script (rough draft order and logic is more important than syntax at this stage). Feedback would be appreciated on things such as setting up a OpenMRS user and DataBase in MySQL first or not … still working on step 6 onwards


Cook script V0.1

#Step 1. Install JAVA

sudo apt-get install default-jdk sudo update-alternatives --config java

#Step 2. Install MySQL

sudo apt-get install mysql-server Enter and remember your root password

#Step 3. Install Tomcat and change user security

sudo apt-get install tomcat7 sudo apt-get install tomcat7-docs tomcat7-admin tomcat7-examples default-jdk ant git sudo nano /etc/tomcat7/tomcat-users.xml

   <tomcat-users>
    <user username="<?Username?>" password="<?password?>" roles="manager-gui,admin-gui"/>
    </tomcat-users>

sudo service tomcat7 restart

#Step 4. Download openmrs.war from openmrs.org https://sourceforge.net/projects/openmrs/files/prereleases/OpenMRS_Platform_2.0.0_Beta/3

#Step 5 : Change upload size to in Tomcat to upload openmrs.war To increase upload size limit in tomcat edit webapps/manager/WEB-INF/web.xml configuration file and search for below content.

      <max-file-size>52428800</max-file-size>
      <max-request-size>52428800</max-request-size>
      <file-size-threshold>0<</file-size-threshold>

  </multipart-config>

cd /usr/share/tomcat7-admin/manager/WEB-INF nano WEB-INF

Edit max-file-size and max-request-size and increase it as your requirement. These values are defined in bytes and the default value is set to 50Mb. (104857600 = 100MB)

      <max-file-size>104857600</max-file-size>
      <max-request-size>104857600</max-request-size>
      <file-size-threshold>0<</file-size-threshold>

  </multipart-config>

After making all above changes, You need to restart Tomcat instance

sudo /etc/init.d/tomcat7 restart

#Step 6: Set up Tomcat directory

sudo mkdir /usr/share/tomcat7/. OpenMRS sudo chown -R tomcat7 /usr/share/tomcat7/. OpenMRS

#Step 7: Setup MSQL

sudo mysqladmin --user=root ….

#Step 6 : Nav to site…… open http://<IP Address> or <localhost>:8080/OpenMRS

@oliebolz i love the fact that you are proposing something very important and then stepping up to make it happen. Please keep it up. We need more people like you! :smile:

Please go ahead and update the documentation. These pages have people watching them and will get notified every time you make changes. They will hence give you feedback whenever it is necessary. :slight_smile:

I will shortly add the windows environment set up. since the one @oliebolz is explaining is linux

Thanks @taremwatadeo! I can’t wait to see it. :slight_smile:

thanks for doing this. Adding @ayeung and @osg4openmrs who have also been working on some of our documentation.

thanks for this. I was going through the install docs and I noticed some stuff was old. Like you said a SA can figure out most of the stuff out. I was going to update but, have been busy lately.

Installing and running OpenMRS on a windows machine

Step 1. Install JAVA download jdk from http://www.oracle.com/technetwork/java/javase/downloads/index.html and click the downloaded file and follow instructions to install step 2. setting the environment variables Windows 10 and Windows 8 **1.**In Search, search for and then select: System (Control Panel) **2.**Click the Advanced system settings link. **3.**Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New. **4.**In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable . Click OK. . **note:**the value of the path is got by navigating to the bin folder where jdk was installedfor example for my case “D:\ProgramFiles\Java\jdk1.7.0_79\bin”. 5. In the user variables ,Click new and write JAVA_HOME on the variable name and on the variable value put the path to the parent folder where the jdk was installed , in my case “D:\ProgramFiles\Java\jdk1.7.0_79” and click OK, Close all remaining windows by clicking OK. 6. Open command line and type java -version to confirm whether jdk has been installed and it should return the version installed and the runtime environment Note For windows 7 the same instructions can be followed and also the environment variables may be accessed by right clicking on the computer icon on the desktop, select properties from the context menu and click the advanced system settings link and follow the steps like above

Step 3. Installing Mysql and Tomcat Note with windows you can decide to install each of the above on its own or install xampp software which is packaged with mysql, tomcat, apache server, php and phpmyadmin 1. using xampp software Down load xampp from https://www.apachefriends.org/download.html and click the downloaded file to install xampp on your computer , it contains a control panel from where you can start and stop your server ,mysql or tomcat

Configuring mysql navigate to the xampp installation folder , open the phpmyadmin folder and open the file config.inc which is a php file and set the password for root user

/* Authentication type and info */ /* $cfg['Servers'][$i]['auth_type'] = 'config'; */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['user'] = 'root'; $cfg['Servers'][$i]['password'] = 'password'; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['Lang'] = '';

configuring tomcat-user navigate to the xampp installation folder , open the folder tomcat/conf and open the file tomcat-users which is an xml file where you will set roles and users for example <role rolename="admin-gui"/> <role rolename="admin-script"/> <role rolename="manager-gui"/> <role rolename="manager-status"/> <user username="admin" password="secret1" roles="admin-gui,admin-script"/> <user username="manager" password="secret2" roles="manager-gui,manager-status"/>

Note you to restart the services i.e mysql and tomcat for the configured changes to take effect

2. Installing myql and tomcat separately mysql Download mysql from http://dev.mysql.com/downloads/ and install, on configuration instead navigate to the mysql installation folder tomcat Download tomcat from https://tomcat.apache.org/download-70.cgi and install, on configuration navigate to the tomcat installation folder set the CATALINA_HOME in environment variables and add tomcat to the system path

Note: Incase you need to run the openmrs standalone version , the remaining steps maynot be followed as they are for anyone who would want to install openmrs enterprise or make an advanced install

Step 4. Download openmrs.war from openmrs.org https://sourceforge.net/projects/openmrs/files/prereleases/OpenMRS_Platform_2.0.0_Beta/3

Step 5 : Change upload size to in Tomcat to upload openmrs.war To increase upload size limit in tomcat edit webapps/manager/WEB-INF/web.xml configuration file and search for below content.

<max-file-size>52428800</max-file-size> <max-request-size>52428800</max-request-size> <file-size-threshold>0<</file-size-threshold> </multipart-config>

Edit max-file-size and max-request-size and increase it as your requirement. These values are defined in bytes and the default value is set to 50Mb. (104857600 = 100MB)

<max-file-size>104857600</max-file-size> <max-request-size>104857600</max-request-size> <file-size-threshold>0<</file-size-threshold> </multipart-config>

Restart tomcat after making the above changes

Stp 6. uploading the openmrs.war **1.**Start tomcat and mysql **2.**Open the browser(firefox or chrome) and put your localhost address. depending on how you set it and the port on which tomcat is running for my case “http://localhost:9990/NB tomcat runs on port 8080 by default and hence on first install it would be “http://localhost:8080/3. Click on manager app and put the username and password specified for rolename “manager-gui” in the tomcat-user configuration 4. the manager app will open and navigate to where they instruct to deploy the app and upload the openmrs.war **5.**Open browser and run your localhost:port/openmrs **6.**it will bring the initial set up from where to configure openmrs

@taremwatadeo

nice work mate - now I have to get my stuff more sorted :slight_smile: … here’s hoping i have some time on the weekend

Thanks @taremwatadeo :slight_smile: Can you edit the actual wiki page?

Sure , yah will work on it before this weekend ends

Thank you so so much. This is exactly what i was looking for :smile:

1 Like

hi. thank you for the steps to setup OpenMRS. I’ve gone through all the steps and now I’m only able to see the page below, but I’m not able to go beyond that page. I’m seeing this page

“If you are seeing this page, it means that the OpenMRS Platform is running successfully, but no user interface module is installed. Learn about the available User Interface Modules”

I’ve downloaded the zip file for the modules and dropped all the modules under /openmrs/web-info/bundledModules/ . still doesn’t see the login page. Am I missing a few steps or configuration update?

I’m running Tomcat 6 ( I used tomcat 9 before, but downgraded to 6 later just to see if it works.) java 8 Ubuntu

thanks in advance for your guidance.

thanks, c

@andersont could you please check whether you can help @christopherthant , since your good at ubuntu installations

@christopherthant You should put the ui .omod file in the OpenMRS/modules directory. I believe this will be located in your home directory. Make sure you refresh the page when you do so because the error will be cached. We ran into this same issue as well.

If you check your tomcat log files, you should see a message like “Using runtime properties file: …”. The mentioned runtime properties file will be in your application data folder. It is in there that you will see a folder named “modules” to paste your omods.

1 Like

@andersont , @dkayima thank you so much. yes. I was placing into wrong folder. some module are not able to load because mysql version does not allowed default date with zeros. still struggling a little bit. I will keep you posted.