In this
tutorial we learn how to install apache tomcat9 (9.0.13) 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.13) in linux
Step1: we need to check java version
before installing apache tomcat9 (9.0.13). 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.13)
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.13/bin/apache-tomcat-9.0.13.tar.gz
--2018-12-11
15:05:49--
https://archive.apache.org/dist/tomcat/tomcat-9/v9.0.13/bin/apache-tomcat-9.0.13.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: 9988120 (9.5M)
[application/x-gzip]
Saving to:
“apache-tomcat-9.0.13.tar.gz”
100%[======================================>]
9,988,120 191K/s in 60s
2018-12-11 15:06:52
(161 KB/s) - “apache-tomcat-9.0.13.tar.gz” saved [9988120/9988120]
To extract the package we need to
execute the below command.
[root@localhost tmp]#
tar -xvf apache-tomcat-9.0.13.tar.gz
After extract the tar package we got
the below directory
[root@localhost tmp]#
ll
total 27776
drwxr-xr-x. 9 root
root 4096 Dec 8 07:46 apache-tomcat-9.0.13
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.13 /opt
Step4:
now go to the /opt/ apache-tomcat-9.0.13/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.13
Using CATALINA_HOME: /opt/apache-tomcat-9.0.13
Using CATALINA_TMPDIR:
/opt/apache-tomcat-9.0.13/temp
Using JRE_HOME: /usr
Using CLASSPATH:
/opt/apache-tomcat-9.0.13/bin/bootstrap.jar:/opt/apache-tomcat-9.0.13/bin/tomcat-juli.jar
Tomcat started.
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 1393/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