Install Apache Tomcat 9 on CentOS/RHEL/Oracle | In this
tutorial we learn how to install apache tomcat 9 (9.0.14) on linux step by step.
So first we have to know what is apache tomcat
What is Apache tomcat
Apache tomcat
is an open source software which is used to deploy java servlets and jsp.apache
is used for http service and tomcat acts
as a sevrlets used for java technology.
Installation methods of apache tomcat9 (9.0.14) on linux
Step1: we need to check java version
before installing apache tomcat9( 9.0.14). To check the java version we execute
the below command.
[root@localhost ~]#
java -version
openjdk version
"1.8.0_191"
OpenJDK Runtime
Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server
VM (build 25.191-b12, mixed mode)
Step2: After checking the java version we
need to download apache tomcat9
(9.0.14) tar package and exact the package into the /tmp folder. To
download the packages we use wget if it is not installed on system ,to install
it execute the below command.
[root@localhost ~]# yum install wget
[root@localhost
tmp]# wget
https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.14/bin/apache-tomcat-9.0.14.tar.gz
--2019-01-01
16:38:44-- https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.14/bin/apache-tomcat-9.0.14.tar.gz
Resolving
archive.apache.org... 163.172.17.199
Connecting to
archive.apache.org|163.172.17.199|:443... connected.
HTTP request sent,
awaiting response... 200 OK
Length: 10492627 (10M)
[application/x-gzip]
Saving to:
“apache-tomcat-9.0.14.tar.gz”
100%[======================================>]
10,492,627 138K/s in 1m 46s
2019-01-01 16:40:33
(96.8 KB/s) - “apache-tomcat-9.0.14.tar.gz” saved [10492627/10492627]
To extract the package we need to
execute the below command.
[root@localhost tmp]#
tar -xvf apache-tomcat-9.0.14.tar.gz
After extract the tar package we got
the below directory
[root@localhost tmp]#
ll
drwxr-xr-x. 9 root
root 4096 Jan 1 16:41 apache-tomcat-9.0.14
Step3: after completed the above steps move
the directory to /opt folder. To move the directory to opt we execute the below
command
[root@localhost tmp]#
mv apache-tomcat-9.0.14 /opt
Step4:
now go to the /opt/ apache-tomcat-9.0.14/bin directory and execute startup.sh script to
start the apache tomcat service.
[root@localhost bin]#
./startup.sh
Using
CATALINA_BASE:
/opt/apache-tomcat-9.0.14
Using
CATALINA_HOME:
/opt/apache-tomcat-9.0.14
Using CATALINA_TMPDIR:
/opt/apache-tomcat-9.0.14/temp
Using JRE_HOME: /usr
Using CLASSPATH:
/opt/apache-tomcat-9.0.14/bin/bootstrap.jar:/opt/apache-tomcat-9.0.14/bin/tomcat-juli.jar
Step5: After starting the service we need
to check that apache tomcat port is listening or not to use the below command.
[root@localhost ~]#
netstat -tulpn | grep 8080
tcp 0
0 :::8080
:::* LISTEN 1328/java
From the above output we saw that
apache tomcat service is listening 8080 port.
Step6: After that you need to allow 8080
port in iptables .In my case iptables is not running.
For reference for iptables on linux
go to below link.
https://techrideradmin.blogspot.com/2018/10/iptables-firewall-rule-chains-configuration-guide-on-linux-with-examples-for-beginners.html
Step7: After completed all the above
stuff we verify through web browser.open the web browser and type http://serverip:8080
In our case server ip is
192.168.137.3
0 comments:
Post a Comment