Tomcat Web Server
Tomcat Web Server
Web server is a software application that serves content (such as web pages, images, or other resources)
to clients over the internet or an intranet. It listens for incoming requests from clients (usually web
browsers) and responds by delivering the requested content. The primary purpose of a web server is to
handle the HTTP protocol, which is the foundation of data communication on the World Wide Web.
Apache Tomcat:
Apache Tomcat, often referred to simply as Tomcat
HTTP Listener: Tomcat acts as an HTTP listener, receiving incoming HTTP requests from clients
(typically web browsers). It processes these requests and sends back appropriate responses.
Static Content: Tomcat can serve static content like HTML, CSS, JavaScript files, and images,
similar to other web servers.
Concepts:
Web Application Directory Structure: In Tomcat, web applications are typically
organized in a directory structure within the "webapps" directory. Each web application resides in its
own folder, and it contains directories for various components like WEB-INF, classes, lib, and more.
Server Configuration: Tomcat's main configuration files are found in the "conf" directory. Key
configuration files include "server.xml" (overall server configuration), "web.xml" (individual web
application configuration), and "context.xml" (per-web-application context configuration).
Tomcat Manager: Tomcat comes with a built-in web application called "Manager" that allows
you to deploy, undeploy, and manage web applications from a web-based interface. It's accessible at
http://localhost:8080/manager by default.
Catalina: Catalina is the Tomcat component responsible for processing HTTP requests and managing
servlets and JSPs. Understanding the Catalina component is important for troubleshooting and
performance tuning.
Logs: Tomcat generates logs that provide information about server activities and errors. Logs are
stored in the "logs" directory and include files like "catalina.out", "localhost.log", and more.
• catalina.sh or catalina.bat: Used for various administrative tasks like creating new webapp
instances, setting environment variables, etc.
Deployments: Web application deployments are typically managed by copying the web
application's WAR (Web Archive) file into the "webapps" directory. Tomcat automatically deploys the
application and extracts its contents.
• Save the file and reload the shell profile (source ~/.bashrc or restart your terminal).
echo $PATH
(to change the port from 8080 to other available port in order to avoid the conflict with Jenkins port
sudo nano /etc/tomcat9/server.xml
user is added