Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 17390 invoked from network); 14 Sep 2010 22:11:04 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 14 Sep 2010 22:11:04 -0000 Received: (qmail 67795 invoked by uid 500); 14 Sep 2010 22:11:01 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 67710 invoked by uid 500); 14 Sep 2010 22:11:00 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 67701 invoked by uid 99); 14 Sep 2010 22:11:00 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 22:11:00 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of alecswan@gmail.com designates 209.85.212.45 as permitted sender) Received: from [209.85.212.45] (HELO mail-vw0-f45.google.com) (209.85.212.45) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Sep 2010 22:10:39 +0000 Received: by vws19 with SMTP id 19so8316899vws.18 for ; Tue, 14 Sep 2010 15:10:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=CkWPlpe7mktQwA75V1XFfob7ZDfvug+/2OyJLU/NgEA=; b=cenTINHOozb5tErs6oddY1PB+BVfS3LxgSHI3788CK6pS8TttJfx4bgACFtEDwP2vR mTervNwNs2dqRv7T+3/8jTBQBFfMzcpuTxXnrgACuZv9Xr3CqpkBSSA4zyKaYS6LeyLp YAwRbz2UuYCFNQdurXAcNtRnj2I9qB9ayremk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ACYyWhtW9IJyWM/YBwUbDyAlZPlAKaX0OUQiB4M2pzh+areBjkOlskaugw/B0mZAGf wVMfxW+z5lUzuYyD2jSdN+V70bKorGiSrjPWlfNGEwvpWvBdOoZiO/OCo/LtKZWwCrCl yav9omEcdfD2fisMjtwueGzc55xHSO38DznKg= MIME-Version: 1.0 Received: by 10.220.157.140 with SMTP id b12mr306379vcx.156.1284502218233; Tue, 14 Sep 2010 15:10:18 -0700 (PDT) Received: by 10.220.188.205 with HTTP; Tue, 14 Sep 2010 15:10:18 -0700 (PDT) In-Reply-To: <4C8FEFFB.9090507@pidster.com> References: <4C8FE69B.2010507@christopherschultz.net> <4C8FEFFB.9090507@pidster.com> Date: Tue, 14 Sep 2010 16:10:18 -0600 Message-ID: Subject: Re: Virtual host deployment From: Alec Swan To: Tomcat Users List Content-Type: multipart/alternative; boundary=e0cb4e8877d76e59cf04903f7a70 X-Virus-Checked: Checked by ClamAV on apache.org --e0cb4e8877d76e59cf04903f7a70 Content-Type: text/plain; charset=ISO-8859-1 GlobalResources sounds like what I am looking for. According this page ( http://tomcat.apache.org/tomcat-6.0-doc/config/globalresources.html) it seems like I need to just add the following configuration in server.xml: ... ... If I understand correctly, this will make jdbc/EmployeeDB JNDI resource available to every web application deployed in the container, correct? Will it override the JNDI resource definition packaged in META-INF/context.xml inside of the WAR file? Thanks! On Tue, Sep 14, 2010 at 3:58 PM, Pid wrote: > On 14/09/2010 22:52, Alec Swan wrote: > > Hi Chris, > > > > Thank you for the defaultHost recommendation. > > > > The deployment scenario I would like to support requires deploying the > same > > WAR file on the development server first and then on the production > server. > > Development and production servers use different database credentials, so > I > > cannot package them in the WAR file itself. So, the database credentials > > should be stored somewhere in the server configuration. > > > > What is the recommended way to support this scenario? Is there any other > > place besides conf/context.xml where I can store server-specific DB > > credentials? > > You're not defining the DB Resource in GlobalResources? > > > p > > > Thanks, > > > > Alec > > > > On Tue, Sep 14, 2010 at 3:18 PM, Christopher Schultz < > > chris@christopherschultz.net> wrote: > > > > Alec, > > > > On 9/14/2010 5:04 PM, Alec Swan wrote: > >>>> I have a WAR file which I distribute to multiple servers with multiple > >>>> virtual hosts. On each server I have a database, which is accessed by > all > >>>> virtual host apps on this server. > > > > I'm interested: is the WAR actually identical, including all settings > > for all virtual hosts? If so, you can save yourself a lot of memory and > > database connections by deploying a single copy to a single and > > either setting that host as the "defaultHost" for the or using > > within the . > > > >>>> Is it the right approach to put database access credentials in > >>>> $TOMCAT/conf/context.xml > > > > No. You shouldn't really modify conf/context.xml unless you have a > > really really good reason to do so. > > > >>>> which will then be loaded by each virtual host app > >>>> or should I put them somewhere else? > > > > Put the for your database connection pool into your webapp's > > META-INF/context.xml file. > > > > -chris > >> > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > >> > >> > > --e0cb4e8877d76e59cf04903f7a70--