How to use environment variable in nuxeo.conf?


I am trying to use a environment variable in nuxeo.conf. I am using Ubuntu 14.04.1 LTS.

I installed Nuxeo through apt-get from the Nuxeo repository.

I added “DBHOST=localhost” to “/etc/environment” then sourced the file.

When I do “echo $DBHOST” I get the output “localhost”.

Then I changed the line in nuxeo.conf to “${DBHOST}” but when I start the server it fails because it cannot connect to the database.

It works fine if I do “”.

0 votes

1 answers



Unfortunately there is no support in nuxeo.conf to read environment variables.

What you could do is change nuxeoctl to upate/rewrite nuxeo.conf with your environment variable before the normal startup.

0 votes

From "How not to hardcode some properties

It is possible to keep some "dynamic" aspect on some parameters by giving them a variable as value: for instance,${} Then, you can use the produced Nuxeo WAR in an environment where is defined from outside."

From "Those parameters can be either environment parameters used by Nuxeo runtime or template parameters used for values replacement in configuration files."

Is this correct? Can you elborate?


The wording is not meant to refer to OS environment variables. We'll rephrase that, thanks for the pointers.