Apache Tomcat Directory Structure details

Interview question: What is tomcat directory structure ?

This is very typical question if you go inteview where they use Tomcat server to run their application. Below is directory structure of apache-tomcat-7.0.62 . When you install Apache tomcat in your system you will see below:

Apache Tomcat Directory Structure details

  • Details of folders:

bin: Startup/shutdown scripts and other useful files.
conf: Configuration files, including modules.xml, server.xml, and a number of apps-.xml.
conf/auto: Directory where auto-generated configuration files are written.
conf/jk: Directory containing mod_jk specific configuration files.
conf/jserv: Directory containing mod_jserv specific configuration files.
conf/users: Directory containing user name/password configuration files. These are used by the SimpleRealm module for authentication.
doc: Miscellaneous documents regarding Tomcat.
lib: Jar files that are used for starting and stopping Tomcat.
lib/container: Jar files that make up the Tomcat server classes. Any Jar file in this directory is automatically included in Tomcat’s Server Classloader.
lib/common :Jar files that contain classes shared between the Tomcat server and all web applications. Any Jar file in this directory is automatically included in Tomcat’s Common Classloader.
lib/apps: Jar files that contain classes shared between all web applications. Any Jar file in this directory is automatically included in Tomcat’s Apps Classloader.
logs: This is where Tomcat places its log files by default.
modules: Directory where “add-on” WARs are placed.
native: Base directory for native source code.
src: Currently empty. Tomcat’s source code isn’t currently part of the binary distribution.
webapps: Sample web applications. Any .war files placed here will be automatically expanded. All application war file will go here for deployment.

  • Additionally or Tomcat will create the following directories:

work: Where Tomcat places intermediate files (such as compiled JSP files) during its work. If you delete this directory while Tomcat is running you will not be able to execute JSP pages.
classes: Any class that you add to this directory will find its place in Tomcat’s classpath.

  • Details directory with sub-directories:
apache-tomcat-7.0.62
	├───bin
	├───conf
	├───lib
	├───logs
	├───temp
	├───webapps
	│   ├───docs
	│   │   ├───api
	│   │   ├───appdev
	│   │   │   └───sample
	│   │   │       ├───docs
	│   │   │       ├───src
	│   │   │       │   └───mypackage
	│   │   │       └───web
	│   │   │           ├───images
	│   │   │           └───WEB-INF
	│   │   ├───architecture
	│   │   │   ├───requestProcess
	│   │   │   └───startup
	│   │   ├───config
	│   │   ├───elapi
	│   │   ├───funcspecs
	│   │   ├───images
	│   │   ├───jspapi
	│   │   ├───servletapi
	│   │   ├───tribes
	│   │   ├───WEB-INF
	│   │   └───websocketapi
	│   ├───examples
	│   │   ├───jsp
	│   │   │   ├───async
	│   │   │   ├───cal
	│   │   │   ├───checkbox
	│   │   │   ├───colors
	│   │   │   ├───dates
	│   │   │   ├───error
	│   │   │   ├───forward
	│   │   │   ├───images
	│   │   │   ├───include
	│   │   │   ├───jsp2
	│   │   │   │   ├───el
	│   │   │   │   ├───jspattribute
	│   │   │   │   ├───jspx
	│   │   │   │   ├───misc
	│   │   │   │   ├───simpletag
	│   │   │   │   └───tagfiles
	│   │   │   ├───jsptoserv
	│   │   │   ├───num
	│   │   │   ├───plugin
	│   │   │   │   └───applet
	│   │   │   ├───security
	│   │   │   │   └───protected
	│   │   │   ├───sessions
	│   │   │   ├───simpletag
	│   │   │   ├───snp
	│   │   │   ├───tagplugin
	│   │   │   └───xml
	│   │   ├───servlets
	│   │   │   ├───chat
	│   │   │   └───images
	│   │   ├───WEB-INF
	│   │   │   ├───classes
	│   │   │   │   ├───async
	│   │   │   │   ├───cal
	│   │   │   │   ├───chat
	│   │   │   │   ├───checkbox
	│   │   │   │   ├───colors
	│   │   │   │   ├───compressionFilters
	│   │   │   │   ├───dates
	│   │   │   │   ├───error
	│   │   │   │   ├───examples
	│   │   │   │   ├───filters
	│   │   │   │   ├───jsp2
	│   │   │   │   │   └───examples
	│   │   │   │   │       ├───el
	│   │   │   │   │       └───simpletag
	│   │   │   │   ├───listeners
	│   │   │   │   ├───num
	│   │   │   │   ├───sessions
	│   │   │   │   ├───util
	│   │   │   │   ├───validators
	│   │   │   │   └───websocket
	│   │   │   │       ├───chat
	│   │   │   │       ├───drawboard
	│   │   │   │       │   └───wsmessages
	│   │   │   │       ├───echo
	│   │   │   │       ├───snake
	│   │   │   │       └───tc7
	│   │   │   │           ├───chat
	│   │   │   │           ├───echo
	│   │   │   │           └───snake
	│   │   │   ├───jsp
	│   │   │   │   └───applet
	│   │   │   ├───jsp2
	│   │   │   ├───lib
	│   │   │   └───tags
	│   │   ├───websocket
	│   │   └───websocket-deprecated
	│   ├───host-manager
	│   │   ├───images
	│   │   ├───META-INF
	│   │   └───WEB-INF
	│   │       └───jsp
	│   ├───manager
	│   │   ├───images
	│   │   ├───META-INF
	│   │   └───WEB-INF
	│   │       └───jsp
	│   └───ROOT
	│       └───WEB-INF
	└───work

For more information please visit Apache Tomcat here

Leave a Reply

Your email address will not be published. Required fields are marked *