Aim:
In this tutorial, we will install Tomcat 9.0.21 on Linux.
Step 1: Installing JDK
- Tomcat 9 requires Java 8 or later versions. Check Java installation:
$ java -version
- If Java is not installed, run the following commands to install Java:
$ sudo apt-get update
$ sudo apt-get install default-jdk -y
- After installation, verify Java installation:
$ java -version
Step 2: Creating a Tomcat user and group
- Create a group and user for Tomcat:
$ sudo groupadd tomcat
$ sudo useradd -s /bin/false -g tomcat -d /opt/tomcat tomcat
Step 3: Download and Install Tomcat 9
- Change directory to /opt and download Tomcat 9 to that directory:
$ cd /opt
$ sudo wget https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.21/bin/apache-tomcat-9.0.21.tar.gz
- Extract the tar package and rename the extracted directory to tomcat:
$ sudo tar -xvzf apache-tomcat-9.0.21.tar.gz
$ sudo mv apache-tomcat-9.0.21 /opt/tomcat
Step 4: Set Up Path Variable and Start Tomcat
- Navigate to the bin directory within Tomcat:
$ cd /opt/tomcat/bin
- Add Tomcat's bin directory to the PATH variable (temporary):
$ export PATH=$PATH:$(pwd)
- Start Tomcat using catalina.sh:
$ ./catalina.sh start
Comments
Post a Comment