April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Tomcat log automatic deletion implementation

Tomcat log automatic deletion implementation

ackground

In the production environment, Tomcat generates a lot of logs every day. If you don’t clean up the disk capacity, it will be enough. Manual cleaning is too much trouble. Therefore, write a script to delete the log files 5 days ago (depending on the actual situation).

Writing […]

Tomcat log cutting script

time=$(date +%H) end_time=`expr $time – 2`a=$end_timeBF_TIME=$(date +%Y%m%d)_$a:00-$time:00cp /usr/local/tomcat8/logs/catalina.out /var/log/tomcat/oldlog/catalina.$BF_TIME.outecho ” ” > /usr/local/tomcat8/logs/catalina.out

catalina.out

mkdir -p /var/log/tomcat/oldlog/

chmod  +x  /root/tom_log.sh

 crontab -e0 */2 * * * sh /root/tom_log.sh

ls /var/log/tomcat/oldlog/

catalina.20190102_15:00-17:00.out  catalina.20190102_17:00-19:00.out

[…]

tomcat tuning

Sync sync disk

echo 3 > /proc/sys/vm/drop_caches # Clean up useless memory space

Tomcat8 final configuration 1.${tomcat}/bin/catalina.sh Join 1.${tomcat}/bin/catalina.sh JAVA_OPTS=”-Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms1G -Xmx1G -Xss256k -XX:NewSize=1G -XX:MaxNewSize=1G -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+DisableExplicitGC”

2. 2. JAVA_OPTS=”$JAVA_OPTS -server -Xms3G -Xmx3G -Xss256k -XX:PermSize=128m -XX:MaxPermSize=128m -XX:+UseParallelOldGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/aaa/dump -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/usr/tomcat/dump/heap_trace.txt -XX:NewSize=1G -XX:MaxNewSize=1G”

2.${tomcat}/conf/server.xml Open commented out

<Executor name=”tomcatThreadPool” namePrefix=”catalina-exec-” maxThreads=”300″ […]

mod_jk or mod_proxy_ajp ?

mod_jk or mod_proxy_ajp ?

A Tomcat servlet container can be put behind an Apache web server using the AJP protocol, which carries all request information from Apache to Tomcat. There are two implementations of AJP module:

mod_jk which must be installed separately mod_proxy_ajp which is a standard module since Apache 2.2

They both use protocol […]

Tomcat log cutting and regular deletion

Tomcat log cutting and regular deletion

In Tomcat’s software environment, if we allow log files to grow indefinitely, one day the disk is full (crap). Especially in the case of log file growth is very fast, cutting log files by log and delete, is a very necessary work, the following describes the method of cutting […]

tc server run level RHEL7

ln -s /usr//tcServer/APP/bin/init.d.sh /etc/init.d/tc_APP /sbin/chkconfig –add tc_APP /sbin/chkconfig –level 2345 tc_APP on

#!/bin/sh # # ————————————————————————— # tc Runtime application server bootup script # # Copyright (c) 2009-2011 VMware, Inc. All rights reserved. # ————————————————————————— # chkconfig: 2345 80 20 # description: Start up the tc Runtime application server # version: 2.9.2.RELEASE # build […]

SSL 64-bit Block Size Cipher Suites Supported (SWEET32) – Tomcat

Following on from the Windows vulnerability for SWEET32, Here’s how to resolve the same issue with Tomcat 8. This use the OpenSSL format string for ciphers, so can also be applied to anything using the same cipher list.

ciphers=”HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!kRSA:!ECDHE-RSA-DES-CBC3-SHA” Simply by adding the !ECDHE-RSA-DES-CBC3-SHA to your existing : delimited cipher list disables the cipher on […]

Tomcat commonly used in the tuning

Tomcat commonly used in the tuning

In the usual use of Apache, Nginx or other related to the provision of Web services software has a corresponding performance module tuning changes, and in Tomcat also has a corresponding performance tuning modified configuration, here is simply to say more commonly used Several Tomcat in the performance tuning […]

Garbage Priority Garbage Collector

Garbage Priority Garbage Collector (G1 GC) Use notes

G1 GC is a new garbage collection strategy, starting with JDK7, mainly for server-side JVM, and large memory applications, the goal is to achieve similar high-throughput CMS. G1 is still the idea of ??sub-management, the main use of the idea of ??block management, through the memory […]

tomcat monitor script

#!/bin/bash echo $(date ‘+%Y-%m-%d %H:%M:%S’) whoami JAVA_HOME=/opt/java/jdk1.8.0_40 PATH=$JAVA_HOME/bin:$PATH export PATH JAVA_HOME port=8086 sn=“tomcat-image-$port“ th=“/home/dev/tomcat/$sn“ url=“http://you-app-server/” tomcat=`ps -ef | grep java | grep $sn | grep $port | wc -l` if [ $tomcat -eq 0 ] then echo $sn stoped. echo starting $sn …… $th/bin/startup.sh fi if [ $tomcat -ge 1 ] then tpid=`ps -ef | […]