From 01a65d19656fd4452c7fb1162314f79c8eccfe1f Mon Sep 17 00:00:00 2001 From: Tung Bui Date: Wed, 25 Dec 2024 11:57:13 +0700 Subject: [PATCH] Add Apache Tomcat webserver topic --- README.md | 9 ++- topics/apachetomcat/README.md | 91 +++++++++++++++++++++++++++++ topics/apachetomcat/basic/README.md | 47 +++++++++++++++ 3 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 topics/apachetomcat/README.md create mode 100644 topics/apachetomcat/basic/README.md diff --git a/README.md b/README.md index e771160..f884d8c 100755 --- a/README.md +++ b/README.md @@ -285,7 +285,14 @@ We cover a wide range of DevOps topics in our content library, explore them unde IIS iis 📖 learn.microsoft.com/iis - ⏩ IIS Basics + ✔️ IIS Basics + + + + Apache Tomcat + tomcat + 📖 tomcat.apache.org + ✔️ Tomcat Basics diff --git a/topics/apachetomcat/README.md b/topics/apachetomcat/README.md new file mode 100644 index 0000000..fac0b55 --- /dev/null +++ b/topics/apachetomcat/README.md @@ -0,0 +1,91 @@ +# Apache Tomcat + +## 1. What is Apache Tomcat? + +### Overview + +Apache Tomcat (called "Tomcat" for short) is a free and open-source implementation of the Jakarta Servlet, Jakarta Expression Language, and WebSocket technologies. It provides a "pure Java" HTTP web server environment in which Java code can also run. Thus it is a Java web application server, although not a full JEE application server. +Tomcat is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation, released under the Apache License 2.0 license. + +Source: https://en.wikipedia.org/wiki/Apache_Tomcat + +### Official Website of Apache Tomcat + +- https://tomcat.apache.org/ + +### Official Documentation of Apache Tomcat + +- https://tomcat.apache.org/tomcat-10.1-doc/ + +### What you can do with Apache Tomcat + +- Host Java-based web applications. +- Implement and run Java Servlet and JSP technologies. +- Lightweight and highly customizable deployment platform. +- See details at: https://tomcat.apache.org/tomcat-10.1-doc/introduction.html + +--- + +## 2. Prerequisites + +- Basic knowledge of Java and web server technologies. +- Java Development Kit (JDK) installed on your system. + +--- + +## 3. Installation + +### How to Install Apache Tomcat? + +1. **Download Apache Tomcat**: + + - Visit the official [Apache Tomcat Downloads](https://tomcat.apache.org/download-10.cgi) page. + - Choose the version that matches your needs (e.g., Tomcat 10.1). + +2. **Install Java**: + + - Ensure JDK is installed on your system. Apache Tomcat requires Java to run. + - [Install JDK Guide](https://docs.oracle.com/en/java/javase/17/install/overview-jdk-installation.html) + +3. **Extract and Configure Tomcat**: + + - Extract the downloaded archive to a desired directory. + - Set the `CATALINA_HOME` environment variable to the Tomcat installation path. + +4. **Start Tomcat**: + + - Navigate to the `bin` directory of your Tomcat installation. + - Run `startup.bat` (Windows) or `./startup.sh` (Linux/Mac). + +5. **Verify Installation**: + - Open a browser and go to `http://localhost:8080`. You should see the Tomcat welcome page. + +--- + +## 4. Basics of Apache Tomcat + +### Get started with Apache Tomcat + +- https://tomcat.apache.org/tomcat-10.1-doc/setup.html + +### Apache Tomcat quick start guide + +- Set up and deploy your first servlet or JSP application: + - [Getting Started Guide](https://tomcat.apache.org/tomcat-10.1-doc/appdev/index.html) + +### Apache Tomcat Hands-On + +- See: [basic](./basic/) + +--- + +## 5. More... + +### Apache Tomcat Cheatsheet + +- https://www.javacodegeeks.com/starting-with-apache-tomcat-cheatsheet.html + +### Recommended Books + +- **Tomcat: The Definitive Guide** by Jason Brittain. +- **Professional Apache Tomcat 8** by Vivek Chopra, et al. diff --git a/topics/apachetomcat/basic/README.md b/topics/apachetomcat/basic/README.md new file mode 100644 index 0000000..1fa753d --- /dev/null +++ b/topics/apachetomcat/basic/README.md @@ -0,0 +1,47 @@ +# Apache Tomcat Basics + +This section covers the fundamental concepts and steps to get started with Apache Tomcat. Learn how to set up, configure, and deploy web applications. + +--- + +## 1. Getting Started with Apache Tomcat + +### Starting the Server + +1. Open the terminal and navigate to the `bin` directory of your Tomcat installation. +2. Run the startup script: + - **Windows**: `startup.bat` + - **Linux/Mac**: `./startup.sh` + +### Stopping the Server + +1. Navigate to the `bin` directory. +2. Run the shutdown script: + - **Windows**: `shutdown.bat` + - **Linux/Mac**: `./shutdown.sh` + +--- + +## 2. Configuring Apache Tomcat + +### Change the Default Port + +1. Open the `server.xml` file located in the `conf` directory. +2. Locate the `` element and change the `port` attribute: + +```xml + +``` + +--- + +## 3. Deploying a Sample Application + +- Deploy a Pre-Built `.war` File +- Download a sample `.war` file + - Download the sample application Sample Web Application at https://tomcat.apache.org/tomcat-10.1-doc/appdev/sample/ +- Deploy to Tomcat + - Copy the `.war` file into the webapps directory of your Tomcat installation. + - Access the Application: Open a browser and navigate to http://localhost:8080/sample.