Thanks for the great responses.

@Ognjen: Yes, currently we also use the setenv.sh (because it will not be
touched by an update).
The *ln -s* Tipp is not bad.
But the problem is, it stores the files in the folder (/opt/tomcat/logs).

On our (AWS) installation we have limited space on /opt, therefore we
attached an EBS volume  to /var/, - otherwise we would get problems with
the log files. Now it can grow above some GB.

But because the log dirs are defined in the logging.properties (what get
shipped and overridden by updates) we put this "hack" into our setenv.sh:

sed -i 's/${catalina.base}\/logs/\/var\/log\/tomcat\//g'
\/opt\/tomcat\/conf\/logging.properties

This will replace the sting *${catalina.base}\/logs* with */var\/log\/tomcat
* everytime setenv.sh is executed.

Now we will never forget to touch the logging.properties after an update.
But i still think it is not that elegant...

Best Regards,
Christian.


2013/7/30 Ognjen Blagojevic <ognjen.d.blagoje...@gmail.com>

> Christian,
>
>
> On 30.7.2013 11:58, Christian Schneider wrote:
>
>> But what about:
>> * set env. variables (maybe: catalina.sh?, /etc/profiles?)
>>
>
> /etc/profiles is executed when you enter bash shell, so if Tomcat starts
> at boot time, it won't be able to access environment variables defined in
> /etc/profile.
>
> I set JAVA_HOME, CATALINA_BASE and CATALINA_HOME environment variables in
> /etc/init.d/tomcat (which is a copy of daemon.sh), but I guess there may be
> a better place to do that.
>
> This link [1] recommends to put environment variables in
> /etc/default/tomcat, and then to source them from /etc/init.d/tomcat.
>
>
>
>  * adjust the heap size
>>
>
> Create file $CATALINA_BASE/bin/setenv.sh:
>
> ----
> export CATALINA_OPTS='-Xms...m -Xmx...m'
> ----
>
>
>
>  * logging to the right directory (like: /var/log/tomcat/...)
>>
>
> Maybe something like:
>
> ln -s /var/log/tomcat $CATALINA_BASE/logs
>
>
>
>  * specifying the User: "tomcat"
>>
>
> User 'tomcat' is already specified in daemon.sh, though you may override
> that with $TOMCAT_USER environment variable.
>
> -Ognjen
>
> [1] http://unix.stackexchange.com/**questions/44370/how-to-make-**
> unix-service-see-environment-**variables<http://unix.stackexchange.com/questions/44370/how-to-make-unix-service-see-environment-variables>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@tomcat.**apache.org<users-unsubscr...@tomcat.apache.org>
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to