May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Log Rotation in Catalina.out

1. Remove all logs of manager& admin

Remove 90 days old logs Backup logs greater that 35MB

#!/bin/bash

rm -rf /app/tomcat-6.0.18/logs/*manager* /app/tomcat-6.0.18/logs/*admin*

find /cda1-logs-backups -name ‘*.gz’ -mtime +90 -exec rm {} \;

echo “Initiating logrotate `date +%F-%A`” >> /app/tomcat-6.0.18/logs/diskutil.log

cd /app/tomcat-6.0.18/logs/

siz_catalina=`/bin/ls -l catalina.out | /bin/awk ‘{ print $5 }’`

if [ $siz_catalina -ge “3600000” […]

Rotating catalina.out log files

It is possible to rotate the catalina.out log, by using a log rotation program like rotatelogs or cronolog.

It is possible to rotate the catalina.out log, but it is not controlled by the standard logging.properties or log4j.properties files.

The catalina.out log is stderr and stdout piped to a file. If you want to rotate this […]

catalina.out log rotation

I am interested in catalina.out log file rotation, I have an application where logging to catalina.out is very huge, say 0.5 MB / sec.

So I have written one script to handle this which is shown below.

 

# crontab -l | grep catalina

0,30 * * * * bash /catalina_log_handler.sh >/dev/null 2>&1

 

# […]

TOMCAT SERVER

Reasons for Using a Web Server Apache You may be wondering why a separate Web server is needed when Tomcat already has an HTTP Connector. Following are some reasons: ? Performance—Tomcat is inherently slower than a Web server. Therefore, it is better for the Web server to serve up static content, while Tomcat handles the […]

catalina.out log rotation

Hi,

I am interested in catalina.out log file rotation, I have an application where logging to catalina.out is very huge, say 0.5 MB / sec.

So I have written one script to handle this which is shown below.

# crontab -l | grep catalina

0,30 […]

JMAP, HISTO, Thread Dump, CPU Utilization

Dear Reader,

In a production environment Java Profiling is not an option, we have seen multiple times that our CPU has reached almost 100% or even 300% sometime. That is really a panic scenario especially when you are handling production environment or at client place to check what went wrong.

Fortunately, Java comes with some […]

Install vfabric-web-server & TcServer

mkdir tcserver cd tcserver/ wget -q -O – http://repo.vmware.com/pub/rhel6/vfabric/5.2/vfabric-5.2-suite-installer | sh

yum search vfabric

[root@cluster1 vfabric-web-server]# yum search vfabric Loaded plugins: fastestmirror, refresh-packagekit, security Loading mirror speeds from cached hostfile * base: centos.ipserverone.com * extras: centos.ipserverone.com * updates: centos.ipserverone.com ========================================================= N/S Matched: vfabric ========================================================= vfabric-5.2-repo.noarch : vFabric 5.2 repository configuration vfabric-administration-server.noarch : VMware vFabric Administration […]

Tomcat 8 clustering and Load Balancing Redhat Fedora and Centos

Let us build 3 node Tomcat 8 cluster with Apache

web Server – > 192.168.2.40

cluster2 -> 192.168.1.41 cluster3 -> 192.168.1.42

Web server is CLUSTER1

The characteristics of this cluster are:

Session affinity: sessions are associated with single servers. Failover: if a server dies, a connection will be directed to the nearest available server. […]

Tomcat and Keystore

Keystore and cacerts

Steps:

1. list the existing keys, the default file is .keystore under /usr/local/tomcat folder # cd /usr/local/tomcat # keytool -list -v -storepass changeit

2. delete the existing keys( key alias :tomcat) # cd /usr/local/tomcat # keytool -delete -alias tomcat -storepass changeit

3. generate self-signed key # keytool -h for usage # keytool […]

Tomcat could not run through SSL due to jsse.invalid_ssl_conf

SEVERE: Error initializing endpoint java.io.IOException: jsse.invalid_ssl_conf at org.apache.tomcat.util.net.jsse.JSSESocketFactory.checkConfig(JSSESocketFactory.java:817) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.init(JSSESocketFactory.java:522) … Caused by: javax.net.ssl.SSLException: No available certificate or key corresponds to the SSL cipher suites which are enabled. at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.checkEnabledSuites(SSLServerSocketImpl.java:310) at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.accept(SSLServerSocketImpl.java:255) at org.apache.tomcat.util.net.jsse.JSSESocketFactory.checkConfig(JSSESocketFactory.java:813) … SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]] LifecycleException: Protocol handler initialization failed: java.io.IOException: jsse.invalid_ssl_conf at org.apache.catalina.connector.Connector.initialize(Connector.java:1024) at org.apache.catalina.core.StandardService.initialize(StandardService.java:703) … Cause […]