How to Install Tomcat Server on EC2 Instance/Linux Machine ๐Ÿš€๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

How to Install Tomcat Server on EC2 Instance/Linux Machine ๐Ÿš€๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

ยท

2 min read

\=> Apache Tomcat is a web server โœ…

\=> Apache Tomcat is used to run Java Web Applications ๐Ÿƒ

\=> Apache Tomcat is free & open source ๐Ÿ˜ƒ

\=> Apache Tomcat runs on 8080 port by default (we can change that port) ๐Ÿฅธ

Installation of Tomcat ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป

1) install java software using below command.

$ sudo su
$ yum install java-1.8.0-devel

2) Verify the version of java installed in our machine.

$ java -version

3) We can download apache tomcat from official website. We can find apache tomcat urls to download using official website downloads page.

$ wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.91/bin/apache-tomcat-9.0.91.tar.gz

4) After tomcat tar file got downloaded then extract Tomcat Tar file using below command.

$ tar -xvf <tomcat-tar-file-name>

5) Go inside the Tomcat folder and see the folder structure.

$ cd <tomcat-folder>
$ ls

6) Go to the Tomcat bin directory and run Tomcat Server.

$ cd bin
$ ./startup.sh

Note: Tomcat Server runs on "8080" port by default. Enable this port in security group as custom tcp.

  • Type : Custom TCP

  • Protocol : TCP

  • Port Range: 8080

  • Source : Custom (0.0.0.0/0)

7) Access Tomcat server from your browser.

URL : http://EC2-VM-Public-IP:8080/

In This Way , We can install Tomcat Server on Linux Machine โœ…๐Ÿ’ฏ

ย