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:
- 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:
For more information please visit Apache Tomcat here