tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: ${user.home} and other server.xml tags accepted by Tomcat?
Date Sun, 28 Sep 2008 11:37:15 GMT
Maxim Veksler schrieb:
> Hello list,
> I'm looking for a way to make my tomcat configuration more dynamic
> without resorting to editing xm files. I considering doing this by
> using parameter substitution.
> I've seen from the SSL guide that tomcat will accept configurations
> like """${user.home}""".
> Is there a list, or a known set of these options that tomcat will
> read? Getting at least a reference to the cataline_home will be very
> helpful.
> p.s.
> I know from ant files that you can do ${env.SOMEVAL} to get the
> environment, sadly this does not work here. Is there an equivalent
> alternative ?

The answer depends on the exact version you are using. All version 5.5
and 6 Tomcats and recent version 4.1 Tomcat supports resolving
${somevariable} in server.xml by looking at system properties automatically.

Some properties are set during Tomcat startup, like catalina.home and
catalina.base. Others you can set yourself by either adding to the
commandline "-Dsomevariable=somevalue" or adding to the end of

Not all config files aloow this. I think itself does
only allow for catalina.home and catalina.base and not general system
properties, allows general system properties, I'm not
sure about context.xml and web.xml at the moment (you could try).

Be careful: system properties work, environment variables not. System
properties are often seen as a java equivalent of environment variables,
although those exist in java too.

A common practise in a farms would be, to determine parts of the ports
to bind to in a startup script and to set them in server.xml by using
system properties, so the server.xml file in the whole farm can be kept



To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message