You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tim Gustafson <tj...@tgustafson.com> on 2014/05/18 09:39:58 UTC

Persistent Context Configuration

Hi,

I have a web application that I've deployed on three different virtual
hosts.  Each virtual host requires different configuration data
(specifically, AWS credentials and options that the web application
uses to access AWS services).  In the future, there may be many more
deployments, each with their own set of AWS credentials and options.

I've tried putting these options as parameters in
conf/Catalina/name/ROOT.xml files which works except that file is
deleted each time the web application is redeployed.

Where is the proper place to put virtual-host-specific configuration
options such that they can be easily read from within the web
application and persist across redeployments?  I can't put them in the
WAR file directly because the same WAR file will be re-used by
multiple virtual-hosts, so I need something that I can put in
server.xml or something similar.

Thanks in advance for any help you can give.  :)

-- 

Tim Gustafson
tjg@tgustafson.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Persistent Context Configuration

Posted by Tim Gustafson <tj...@tgustafson.com>.
> For virtual host-specific context configurations, place a
> context.xml.default in:
>
> $CATALINA_BASE/conf/[engine-name]/[host-name]
>
> See the following:
>
> http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

That did the trick; thanks!

-- 

Tim Gustafson
tjg@tgustafson.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Persistent Context Configuration

Posted by Mark Eggers <it...@yahoo.com>.
On 5/18/2014 12:39 AM, Tim Gustafson wrote:
> Hi,
>
> I have a web application that I've deployed on three different virtual
> hosts.  Each virtual host requires different configuration data
> (specifically, AWS credentials and options that the web application
> uses to access AWS services).  In the future, there may be many more
> deployments, each with their own set of AWS credentials and options.
>
> I've tried putting these options as parameters in
> conf/Catalina/name/ROOT.xml files which works except that file is
> deleted each time the web application is redeployed.
>
> Where is the proper place to put virtual-host-specific configuration
> options such that they can be easily read from within the web
> application and persist across redeployments?  I can't put them in the
> WAR file directly because the same WAR file will be re-used by
> multiple virtual-hosts, so I need something that I can put in
> server.xml or something similar.
>
> Thanks in advance for any help you can give.  :)
>
For virtual host-specific context configurations, place a 
context.xml.default in:

$CATALINA_BASE/conf/[engine-name]/[host-name]

See the following:

http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

. . . just my two cents
/mde/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org