-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtomcatSetupComplete.sh
51 lines (33 loc) · 1.21 KB
/
tomcatSetupComplete.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
sudo su
# Update packages
sudo yum update -y
# install git
sudo yum install git -y
# Install Java Development Kit (JDK)
sudo yum install -y java-1.8.0-openjdk-devel # Replace with the appropriate package for your distribution
cd /opt
#Download tomcat binary
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.82/bin/apache-tomcat-9.0.82.tar.gz
#make a folder and unzip tomcat binary
mkdir -p /opt/tomcat
tar -zxf apache-tomcat-9.0.82.tar.gz -C /opt/tomcat --strip-components=1
#go to tomcat bin directory
cd /opt/tomcat/bin/
#gve executable permission to startup and shutdown
chmod +x startup.sh
chmod +x shutdown.sh
#create 2 symbolic link for starting and stutting down tomcat
ln -s /opt/tomcat/bin/startup.sh /usr/bin/tomcatup
ln -s /opt/tomcat/bin/shutdown.sh /usr/bin/tomcatdown
cd /opt/tomcat
#download the scripts
wget https://raw.githubusercontent.com/debadattagadanayak/ShellScripts/main/tomcat_add_roles.sh
wget https://raw.githubusercontent.com/debadattagadanayak/ShellScripts/main/tomcat_comment.sh
#give executable permissions to scripts
chmod +x tomcat_add_roles.sh tomcat_comment.sh
#run scripts
./tomcat_add_roles.sh
./tomcat_comment.sh
sudo rm tomcat_add_roles.sh tomcat_comment.sh
tomcatup