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 Download XAMPP 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 MySQL :: MySQL Community Downloads and install, on configuration instead navigate to the mysql installation folder
tomcat
Download tomcat from Apache Downloads 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
OpenMRS - Browse Files at SourceForge.net
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