Something Different In Linux

Home » Tomcat » Basic tomcat configuration

Basic tomcat configuration

Posted by Rishikesh Vispute Categories: Tomcat

What is Tomcat?

Tomcat is Java driven Web Application Server which Provides support for Java web applications. ie. JSP technologies.
-WAR (Web Application aRchive) files

– Has a self-contained HTTP server





JAVA_HOME ( The path to the JDK )


Logs :


tail -f /usr/local/jakarta/tomcat/logs/catalina.out | egrep

By default, all WAR files are automatically deployed at start up. It can be disabled on a per-host basis with the deployOnStartup attribute.

/usr/local/jakarta/tomcat/bin/jsvc -help

Configuration files reside in :


Most configurations are stored in XML formatted documents


LoadModule jk_module modules/


JkWorkersFile /usr/local/jakarta/tomcat/conf/
JkLogFile /usr/local/apache/logs/mod_jk.log
JkLogLevel info
JkLogStampFormat “[%a %b %d %H:%M:%S %Y] ”
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat “%w %V %T”

# find /usr/local/apache/conf/ -iname cp_jkmount.conf | head -2

Site configurations are included from the Apache userdata directories

Include “/usr/local/apache/conf/userdata/std/2/tom/*.conf”


Example Configuration
JkMount is used to map a context path to a Tomcat worker.

<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
JkMount /*.do ajp13

unzip filename.war

# unzip example.war
Archive: example.war
creating: META-INF/
inflating: helloworld.jsp
creating: WEB-INF/
inflating: WEB-INF/web.xml
inflating: index.html

The appBase is scanned for WAR files every 10 seconds


Check catalina.out to confirm application deployment

How  to deploy web application archive in cpanel account : WAR Deployment :: Configuring mod_jk

  • Drop the WAR file in a directory in the user’s public_html directory
  • mod_jk must be configured to recognize the application now.
  • Add a JkMount code for the application to site include and restart httpd

Example Configuration

<IfModule mod_jk.c>
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /servlets/* ajp13
JkMount /*.do ajp13
JkMount /appname/* ajp13

Resources and References :

Tomcat Project Page :
JDK Download Site :
Useful Tomcat configuration tips :

3 Responses so far.

  1. Keanu says:

    Thanks alottttttttttttttt !!

  2. Hello,

    Thanks for the information.


Popular Posts

remove index.php fro

How to remove index.php from url in magento Ans : If you ...

PHP-Java bridge on p

  What is php-java bridge? The php-java bridge is the php ...

Set expiration for y

If you want to set the expiration to your site ...

Warning: Parameter 1

Error: Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a ...

domain pointing to e

If you domain uses external MX record and it is ...