Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

After installing Tomcat 5 what configuration changes/tweaks do you apply, and why?

Be specific: name what files you edit, what settings you change and why you do it.

Some areas of interest:

  • General configuration changes
  • Best practices with regards to "virtual host handling"
  • Performance tweaks
  • Stability tweaks
  • Security settings
share|improve this question

5 Answers 5

Usually, I'm just tweaking startup parameters to adjust Heap sizes for better performance.

-server -Xms256m -Xmx1024m
share|improve this answer

Here is the simple script I use :

I have the default directoy "Catalina Home' and 'Catalina Base' I put the webapps into 'Catalina base' every time I launch my scripts, war are deployed. I also have some JAVA_OPTS : like run Java in deamon mode, I specify the memory I want to allocate I add the Timezone Also



#export TZ="Europe/Paris"
#export LANG=fr_FR.UTF-8 export CATALINA_PID=$BIN_DIR/
export JAVA_OPTS="-server -Xmx800m
-Djava.awt.headless=true -XX:MaxPermSize=256m"


case $1 in

    $CATALINA_HOME/bin/ start
-config $TOMCAT_DIR/conf/server.xml "$@"    ;;

    stop)   $CATALINA_HOME/bin/
stop -force -config
$TOMCAT_DIR/conf/server.xml "$@"    ;;

    deploy)     if [ ! -d $HOME/deploy ];
then        mkdir $HOME/deploy      fi  if [
-f $HOME/deploy/*.war ]; then       mv $HOME/deploy/*.war
$HOME/tomcat/webapps/   fi  ;;

    *)  echo "Usage : $0 (start|stop)"

share|improve this answer

In context configuration for webapps, which may be in ./conf/Catalina/localhost/.xml, ./webapps/.xml, or within ./conf/server.xml, I set reloadable="false". This prevents Tomcat from constantly polling for changes to the webapp's class files and jars, which is an unnecessary load. See the Context configuration documentation.

<Context path="/myapp" reloadable="true">

In ./conf/server.xml I go through and comment out bits I'm not using, such as unused connectors.

In ./conf/server.xml, look at the values for maxThreads, connectionTimeout, and similar attributes of the Connectors. There is no standard recommended value for these, you need to work out the optimal values based on your application, usage patterns, etc. See the documentation for the HTTP Connector and the AJP Connector for details.

I also strip out the default webapps, except for the ones I need.

Since I do use the tomcat-manager webapp, I lock it down. I configure the user account to access it, and configure Apache httpd access controls on the URL to lock access to relevant IP addresses.

Order deny,allow Deny from all Allow from Allow from 192.168.0

Also in Apache, I block access to the WEB-INF directory (I don't have an example to hand).

share|improve this answer

Heap size for tweaking is better

share|improve this answer

Another good source of information would be this webinar

Unfortunately you have to register....

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.