Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat KeyStore Environment Path

Tags:

tomcat

tomcat7

We have the following example:

< Connector 
           port="8443" maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
           keystoreFile="${user.home}/.keystore" keystorePass="changeit"
           clientAuth="false" sslProtocol="TLS" />

How can I make the "keystoreFile" point to an environment variable? ${env.CATALINA_HOME}/conf/file.jks doesn't works for me. Thanks.

like image 542
Sam Avatar asked Sep 22 '11 17:09

Sam


2 Answers

I know this post is 3 years old....but i ran into the same problem today. So what I found out: tomcat searches the catalina_home as default, so you would just have to say keystoreFile="conf/file.jks" and it will find the keystore at ${env.CATALINA_HOME}/conf/file.jks

Edit: When Starting Tomcat from eclipse this does not work, because the CATALINA_HOME environment variable changes!

like image 187
Bohne Avatar answered Sep 23 '22 13:09

Bohne


If what you actually want is the value of CATALINA_HOME, there is also a system property ${catalina.home} that you can use.

like image 41
Maurice Perry Avatar answered Sep 22 '22 13:09

Maurice Perry