You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Wilson <jn...@dallas.photronics.com> on 2005/02/09 01:28:56 UTC

Re: Recommendation: where to place app config file without overwriting during deploy. JNDI configuration also??

Okay, lets try this variant of my original post..

I've started using JNDI under 5.0.19 and when I deploy to my remote 
server(using /Manager) I need to change the data sources url connect 
string(f/test DB to prod DB). Does everyone use Ant while building the 
WAR to filter/whatever this url? How do you make changes to the context.xml?

Thanks in advance,
   JW

Jonathan Wilson wrote:

> My current upgrade procedures are to shutdown tomcat 3.x, move the 
> current version of my webapp directory somewhere else, recreate the 
> /webapp directory, then un-jar the war file created by NetBeans. After 
> doing this I then have to modify the WEB-INF/app.config file with 
> customer-specific information. The code is identical, just 
> configuration items change. If the customer has changed their 
> app.config then I have to roll those changes into the new app.config 
> file. Also, I have to copy the log files out of the old version into 
> the new versions' /logs directory and modify the stock 
> log4j.properties to point to their desired directory. Also, I can't 
> always have access to the server to do this so I've written a 
> procedure to explain this to another.
>
> Is there a way to store customer configuration info(app.config, 
> log4j.properties) outside of the app and have the app still know how 
> to find it?
>
> There must be a better way - nothing in the Tomcat Application 
> Developers Guide that covers this.
>
> Thanks in advance,
>
> JW
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

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


Re: Recommendation: where to place app config file without overwriting during deploy. JNDI configuration also??

Posted by Roberto Cosenza <ro...@gmail.com>.
Hi Johathan.
We use a different approach.
Everything that is packed in a war is "immutable" i.e. it is not
customer dependent.
Then:
* We store logs outside the war (in /var/log/tomcat/MyWebApp)
* We define connection pools in the context xml file (MyWebApp.xml,
the one in the conf directory). So we have two version of this file,
one to be used in devel and an other to be used in production
* We define any other customer-dependent variable in the file described above.

So, with this approach, the only think you need to to when updating
the war is replacing it!

Apropos log4j.properties, you can define a new value of the system
properties log4j.configuration (? please check the correct name),
which will force log4j to read the log file from an other location.
The problem is that if you define this property, you will have defined
it for the whole container.


I hope I gave a start to your application packaging re-thought.


On Tue, 08 Feb 2005 18:28:56 -0600, Jonathan Wilson
<jn...@dallas.photronics.com> wrote:
> Okay, lets try this variant of my original post..
> 
> I've started using JNDI under 5.0.19 and when I deploy to my remote
> server(using /Manager) I need to change the data sources url connect
> string(f/test DB to prod DB). Does everyone use Ant while building the
> WAR to filter/whatever this url? How do you make changes to the context.xml?
> 
> Thanks in advance,
>   JW
> 
> Jonathan Wilson wrote:
> 
> > My current upgrade procedures are to shutdown tomcat 3.x, move the
> > current version of my webapp directory somewhere else, recreate the
> > /webapp directory, then un-jar the war file created by NetBeans. After
> > doing this I then have to modify the WEB-INF/app.config file with
> > customer-specific information. The code is identical, just
> > configuration items change. If the customer has changed their
> > app.config then I have to roll those changes into the new app.config
> > file. Also, I have to copy the log files out of the old version into
> > the new versions' /logs directory and modify the stock
> > log4j.properties to point to their desired directory. Also, I can't
> > always have access to the server to do this so I've written a
> > procedure to explain this to another.
> >
> > Is there a way to store customer configuration info(app.config,
> > log4j.properties) outside of the app and have the app still know how
> > to find it?
> >
> > There must be a better way - nothing in the Tomcat Application
> > Developers Guide that covers this.
> >
> > Thanks in advance,
> >
> > JW
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 


-- 
Roberto Cosenza
http://robcos.com

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