What's the recommended OpenMRS application directory?

Hi there,

I am installing openmrs 1.11.4 on tomcat7

OS: Ubuntu 14.04 64bit Java: Open JDK 1.7.0_85 Tomcat: 7 (package 7.0.52-1ubuntu0.3) Mysql: 5.5.46

In the install guide https://wiki.openmrs.org/display/docs/Step+3+-+Install+Tomcat

it says to create /usr/share/tomcat6/.OpenMRS for user tomcat6.

I did the same just for tomcat7, but then openmrs wizard does not let me install because it cannot find the openmrs-runtime.properties.

I now create /var/lib/OpenMRS for user tomcat7 and installation runs fine and a openmrs-runtime.properties gets created.

Is that the recommended directory? Does anybody else who is deploying on tomcat7 want to share :slight_smile:

Yes @teleivo, I ran into the same problem when I installed recently. I ended up using the /var/lib/OpenMRS directory for Tomcat 7.

I’ve updated the install guide you mentioned to reflect this.

1 Like

Great, thanks!

I still get these warnings in the log:

WARN - OpenmrsUtil.getRuntimePropertiesFilePathName(2669) |2015-10-30 10:25:41,182| Unable to find a runtime properties file at /var/lib/tomcat7/openmrs-runtime.properties WARN - OpenmrsUtil.getApplicationDataDirectory(1228) |2015-10-30 10:25:41,260| Unable to write to users home dir, fallback to: /var/lib

although openmrs-runtime.properties was created by the wizard in /var/lib/OpenMRS and openmrs runs fine.

do you get these too? is this anything to be concerned about?

Yes, @teleivo, I get the same warning. I think it’s just listing the places it’s checking to find the openmrs-runtime.properties file. So long as it finds the right file, I’m not concerned.

1 Like

@arbaughj @teleivo noticed the solution is to create the .OpenMRS folder in /usr/share/tomcat7 then change the owner of the folder to the tomcat user i.e:

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

1 Like

The solution is to first identify the home directory of the tomcat7/8 user

cat /etc/passwd | grep tomcat

then create .OpenMRS directory in the tomcat users directory. Last is to

chown tomcat8.tomcat8 .OpenMRS

that is it.

2 Likes

I’m a bit late to this conversation, but I second @drexvictor and @whiscard - creating the .OpenMRS folder in /usr/share/tomcat7 is a better solution.

It takes care of a lot of warnings in the log files where openmrs looks for files in the /usr/share/tomcat7 directory, does not find them and then falls back to /var/lib.

I recently faced this. Have updated the install guide to reflect this.

https://wiki.openmrs.org/display/docs/Step+3+-+Install+Tomcat