Skip to content

Commit f2a5225

Browse files
authored
Update install-tomcat.sh
1 parent 2af75d4 commit f2a5225

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

Tomcat-installation/install-tomcat.sh

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,23 @@
11
#!/bin/bash
2-
# Use this script to install tomcat in rehat servers
3-
echo delete the failed version of tomcat
4-
sudo rm -rf /opt/tomcat9
5-
echo assign a hostname to your server
6-
sudo hostname tomcat
2+
# TOMCAT.SH
3+
# Steps for Installing tomcat9 on rhel7&8
74
# install Java JDK 1.8+ as a pre-requisit for tomcat to run.
5+
# https://github.com/LandmakTechnology/package-management/tree/main/Tomcat-installation
6+
sudo hostnamectl set-hostname tomcat
87
cd /opt
98
sudo yum install git wget -y
109
sudo yum install java-1.8.0-openjdk-devel -y
1110
# Download tomcat software and extract it.
12-
sudo yum install wget unzip -y
13-
14-
sudo wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.64/bin/apache-tomcat-9.0.64.tar.gz
15-
sudo tar -xvf apache-tomcat-9.0.64.tar.gz
16-
sudo rm apache-tomcat-9.0.64.tar.gz
17-
sudo mv apache-tomcat-9.0.64 tomcat9
11+
# dowanload and extract tomcat software
12+
sudo wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.69/bin/apache-tomcat-9.0.69.tar.gz
13+
sudo tar -xvf apache-tomcat-9.0.69.tar.gz
14+
sudo rm apache-tomcat-9.0.69.tar.gz
1815
sudo chmod 777 -R /opt/tomcat9
19-
sudo chown ec2-user -R /opt/tomcat9
20-
sh /opt/tomcat9/bin/startup.sh
21-
# create a soft link to start and stop tomcat
16+
sudo sh /opt/tomcat9/bin/startup.sh
17+
# create a soft link to start and stop tomcat from anywhere
2218
sudo ln -s /opt/tomcat9/bin/startup.sh /usr/bin/starttomcat
2319
sudo ln -s /opt/tomcat9/bin/shutdown.sh /usr/bin/stoptomcat
24-
sudo yum update -y
25-
starttomcat
20+
sudo starttomcat
2621
echo "end on tomcat installation"
2722
#========
2823

0 commit comments

Comments
 (0)