December 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Categories

December 2012
M T W T F S S
 12
3456789
10111213141516
17181920212223
24252627282930
31  

TOMCAT TUNING

tuning rules Doesn’t compensate for bad, slow or poorly written applications If you allocate memory more than 3g, preferably divided into multiple tomcat young generation can not be set too much, minor gc will stop the world.

Three factors negatively impact Tomcat’s performance more than any others – network delays, remote client latency, and […]

21 Apache Tomcat Configuration Tips

Tip #1 – Watch Out for White Space

When installing Tomcat under Windows, the path to the installation directory should not contain white space. The default (c:/Program Files) is not acceptable, because it contains a white space character. Installing under “C:/ProgramFiles” is acceptable because this path does not contain any white space characters.

Tip #2 […]

Enable gzip compression in tomcat

Apache tomcat will support gzip compression. The advantage of compression is the output response will be compressed 6 to 10 times.

To enable gzip compression you need to add some additional properties in $APACHE_TOMCAT_HOME_HOME/conf/server.xml file.

Open conf/server.xml from your tomcat home directory with any text editor.

Search for “Connector port=”8080?”, line at this content will […]

Tomcat 6 Access Logging

One of tomcat’s strength is in it’s logging but one of the logger types disabled by default from the base configuration is one that adds access logging support into tomcat. This provides you with a view of activity that you may find useful for debugging, troubleshooting, usage analysis, etc. Enabling it is simply a matter […]

Automatic unlimited subdomains via Apache mod_rewrite

Wondering how blogger website gives you a subdomain from the blogspot.com domain based on your username of your choice? Well, the concept for this tutorial is somewhat related with it on setting up unlimited subdomains. I’m not sure how do they do it because it could be done by any script, hardcoded or not, thru […]

Splitting up Apache Logs for Subdomains

Splitting up Apache Logs for Subdomains

1. Make sure your multiple virtual hosts log to the same log file.

example:@ your config file

ErrorLog “|/usr/sbin/rotatelogs -l /var/log/httpd/linux/error_log.%Y%m%d 86400?CustomLog logs/linux/access_log combinedioCustomLog “|/usr/sbin/rotatelogs -l /var/log/httpd/linux/access_log.%Y%m%d 86400? combinedio

2. Change your Apache LogFormatfrom let say:#LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\”” combined

to:LogFormat “%V […]

Delete old logs

#!/bin/sh #Script to remove 10 days old logs # /usr/bin/find /opt/logs -type f -mtime +10 -exec rm {} \;

Tomcat catalina.out Rotate

tail -f catalina.out becomes 2GB in size, tomcat crashes and fails to start without any error message. To avoid this scenario you should rotate catalina.out frequently. This article describes how to setup auto rotation of catalina.out on a linux/unix machine.

How to automatically rotate catalina.out daily or when it becomes bigger than 5M

1. Create […]