0

I'm trying to set up TeamCity server with HTTPS support. To do so, I must specify keystore file path and keystore password in …/conf/server.xml.

My current Connector is defined there as follows:

<Connector 
    …(some more attributes here)…
    keystoreFile="${keystore.path}" keystorePassword="${keystore.pass}"/>

Whenever I run env TEAMCITY_SERVER_OPTS="-Dkeystore.path='$KEYSTORE_PATH'" ./bin/configtest.sh, I'm getting the error like this:

WARNING: configured file:[/home/app/teamcity/${keystore.path}] does not exist.

(/home/app/teamcity/ is where TeamCity was unpacked) (KEYSTORE_PATH is a correctly defined environment variable, I can write a specific value instead, the result is the same)

That means, TEAMCITY_SERVER_OPTS is not really used for setting arbitrary JVM options for TeamCity server, right?

If so, how can I pass some values and use them in the config? I think hardcoding them is bad.

(if that does matter, I use Ubuntu 14.04 here)

Display Name
  • 8,022
  • 3
  • 31
  • 66

1 Answers1

2

TEAMCITY_SERVER_OPTS is used to pass additional JVM options, but only does so when you run the teamcity-server.sh script. The configtest.sh is part of the Tomcat distro and in this case is not aware of the TeamCity variable. If you try with JAVA_OPTS instead, you can validate:

env JAVA_OPTS="-Dkeystore.path='$KEYSTORE_PATH'" ./bin/configtest.sh

Optionally you could add this line to configtest.sh before the exec of catalina.sh:

export JAVA_OPTS="$JAVA_OPTS $TEAMCITY_SERVER_OPTS"

Will Hogan
  • 909
  • 4
  • 9