Can I run multiple copies of openmrs in the same tomcat instance?


(Stephen Senkomago Musoke) #1

One gripe I have is to install multiple OpenMRS instances can be installed on a single Tomcat container I should be able to have openmrs.war, ugandaemr.war and mycustomemr.war all pointing to different databases.

This means that the global configurations are insulated from each other, therefore the application becomes self contained.


Playing around with OpenMRS in the cloud
(Wyclif Luyima) #2

I believe this is already possible for later versions of OpenMRS


(Stephen Senkomago Musoke) #3

@wyclif I am currently using 2.0.6 and its still still the same … Did this change in 2.1 or 2.2?


(Willa Mhawila) #4

You are saying this is not possible with say 1.11.x versions? I was under the impression this is possible!


(Willa Mhawila) #5

What exactly are you trying to do? Help me understand because I think what you want is very possible.


(Wyclif Luyima) #6

@ssmusoke unless you mean some other issue which possibly you need to explain and give the error you get, otherwise you should be able to run multiple openmrs war files with different names in the same tomcat instance.


(Darius Jazayeri) #7

@ssmusoke I split this into its own thread. I do think it’s possible to run multiple copies of OpenMRS in one tomcat instance. It looks in a different place for the runtime properties file and application dir depending on the webapp name.


(Stephen Senkomago Musoke) #8

@darius I am going to try to simulate the issue again, it was not a runtime properties issue but some internal services, probably JMS.

Need to setup Tomcat which I removed now that I am using the SDK exclusively for development


(Kaweesi Joseph) #9

@ssmusoke I have done this on several occasions with the 1.11.x release line, i actually was still able to run 1.6.7 (in the default ~/.OpenMRS) and 1.11.x (stored in any other place) in the same tomcat container, as @darius mentioned, prepare your war file names to be uniquely named to match your properties files (keep copies in ~/.OpenMRS or its equivalent as well as in pointed to data folders) that point to where your different pieces such as databases, data folders are for all your instances respectively.

This should work since i have used it before without any issues


(Nicholas Ingosi) #10

@psmatsinhe this thread describes how to run multiple openmrs in one tomcat instance, please invite Horacio form FHI into this space


(Nicholas Ingosi) #11

Hi @k.joseph,

And how do you access them on the browser, are you suppossed to do any modifications in the server.xml of the tomcat? looks like those projects are NOT being started by default, it needs someone to get in and start them manually. Is there anything you did such that when you write serverIp:8080/project_name it works automatically, or some changes need to be made?

Thanks


(Kaweesi Joseph) #12

i think if all the project war files exist in tomcat, they should auto deploy, else manually start them in tomcat one after the other


(Wyclif Luyima) #13

You just have to make sure the war files have different names, to access them in the browser you need to use their respective names as the root context paths. E.g if you deployed 2 openmrs war files named openmrs1.war and openmrs2.war on your machine, to access them you would need to to navigate to http://localhost:8080/openmrs1 and http://localhost:8080/openmrs2 respectively.


(Nicholas Ingosi) #14

Thanks @wyclif, we already have those working, but my concern was NOT all the web apps are starting when tomcat is started, some start but others fail, forcing someone to open the manager GUI to start them manually. For instance, I set up 10 openmrs instances and observed only 5 out of ten starts automatically on tomcat restart. So the question is, is there a setting in tomcat that need to be made for them to start when the server starts or this is an openmrs limitation? am on java7 and tomcat7.


(Kaweesi Joseph) #15

probably running to the logs would help u know why those 5 aren’t starting, i don’t think it’s tomcat just ignoring to start all of them!


(Wyclif Luyima) #16

I highly doubt if you can run that many OpenMRS instances on the same machine, you most likely just can’t have enough memory to keep up, and that must be the reason why some instances fail to start.