Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

These properties are loaded when a webapp is started.   It is used to specify database connection settings, custom look and feel per installation, sensitive data, etc.

...

Tip

In the following descriptions, {WEBAPP NAME} is used in place of your web applications name (the name of the war file you loaded). Often this will be openmrs.

Tip

Do not use {APPDATA} in your path. OpenMRS will not render it. It is only used here as an example. In Windows 7+ this is C:\Users\currentuserrunningtomcat\AppData\Roaming\OpenMRS. In Windows XP and below this is C:\Docs and Settings\currentuserrunningtomcat\Application Data\

In some versions of windows, this can be found at C:\Windows\System32\config\systemprofile\Application Data\OpenMRS

While in some others, it can be found at C:\Windows\SysWOW64\config\systemprofile\Application Data\OpenMRS

As of version 1.8, OpenMRS will look for the runtime properties file in this order:

  1. The current directory:

    Code Block
    ./{WEBAPP NAME}-runtime.properties

  2. Using the environment variable

    Code Block
    {WEBAPP NAME}_RUNTIME_PROPERTIES_FILE

  3. User's home directory

    • Windows:

      Code Block
      {APPDATA}/OpenMRS/{WEBAPP NAME}-runtime.properties

    • *Linux:

      Code Block
      ~/.OpenMRS/{WEBAPP NAME}-runtime.properties

      (NOTE: On Linux, in some occasions, it is still necessary to set the

      Code Block
      {WEBAPP NAME}_RUNTIME_PROPERTIES_FILE

      environment variable to point to your file in order to get OpenMRS to read it.)

  4. In the current directory

Note

Prior to version 1.8 the "current directory" was the last location searched for the runtime properties

The runtime properties that can be overwritten are shown below with their default values and a couple of available optional properties:

Code Block

#
# OpenMRS Runtime Properties file
#
# (comments starting with a pound sign "#" are ignored)

### Database connection properties
connection.username=test
connection.password=test
connection.url=jdbc:mysql://localhost:3306/openmrs?autoReconnect=true

## If set to true, allows automatic database updates
#auto_update_database=true

# Allow/Disallow uploading of a module via the web
module.allow_web_admin=false

# If set to true, all patients will be names will be displayed as below
obscure_patients=false
obscure_patients.given_name=John
obscure_patients.middle_name=P.
obscure_patients.family_name=Smith

### Debugging options
hibernate.show_sql=false

### Customization Options
## If the custom setting is a folder, only files contained in the customization will be overwritten
#custom.images.dir=/myfolder/custom/images
#custom.template.dir=/myfolder/custom/template
#custom.style.css.file=/myfolder/custom/style.css
#custom.index.jsp.file=/myfolder/custom/index.jsp
#custom.login.jsp.file=/WEB-INF/view/login.jsp
#custom.messages=/myfolder/custom/messages.properties
#custom.messages_fr=/myfolder/custom/messages_fr.properties
#custom.patientDashboardForm.jsp.file=/WEB-INF/view/patientDashboardForm.jsp

### Other
## Set the directory that OpenMRS uses for its application data
## Will be used as base dir for modules, generated reports, etc
## Defaults to C:/Docs&Settings/username/Application Data/OpenMRS for windows
## Defaults to ~/.OpenMRS for *nix
## (As of build 1.2.0.3426)
# application_data_directory=/opt/openmrs
## Displays optional extra data in the Legacy UI admin screens footer,
## alongside OpenMRS version... etc.
## (As of Legacy UI module 1.7.0)
#legacyui.footer.extradata=Docker Image 45f156d

### Encryption Settings
## WARNING! Changing these values will cause all encrypted data to be invalidated!
## Randomly set upon fresh installation but not during upgrade process.
## OpenMRS built-in defaults are:
#encryption.vector=9wyBUNglFCRVSUhMfsTa3Q==
#encryption.key=dTfyELRrAICGDwzjHDjuhw==

# These properties are deprecated as of 1.7.0
#scheduler.username=admin
#scheduler.password=test

Where is my runtime properties file?

When openmrs OpenMRS starts up, it will print a message to the server log file about where it is.  Look for the string "Using runtime properties file: " and the path following it.

How do I allow automatic database updates when installing a new .war file?

Add:

auto_update_database=true

to your openmrs.runtime-properties file.