-
Notifications
You must be signed in to change notification settings - Fork 2
/
TASK_42-Install_and_Configure_Web_Application.sh
150 lines (94 loc) · 5.38 KB
/
TASK_42-Install_and_Configure_Web_Application.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
-----------------------------------------------------------------------------------------------------------------
Start 2020-07-28 || 03:12 PM
Finished
EXPIRED
-----------------------------------------------------------------------------------------------------------------
TASK 42 - Install and Configure Web Application
REQUIREMENTS:
xFusionCorp Industries is planning to host two static websites on their infra in Stratos Datacenter. The development of these websites is still in -progress, but we want to get the servers ready. The storage server has a shared directory /data that is mounted on each app host under /var/www/html directory. Please perform the following steps to accomplish the task:
a. Install httpd package and dependencies on all app hosts.
b. Apache should serve on port 8080 within the apps.
c. There are two website backups /home/thor/ecommerce and /home/thor/cluster on jump_host. Set them up on Apache in a way that ecommerce should work on link http://<lb-url>/ecommerce/ and cluster should work on link http://<lb-url>/cluster. (do not worry about load balancer configuration, as its already configured).
d. You can access the website on LBR link; to do so click on the + button on top of your terminal, select the option Select port to view on Host 1, and after adding port 80 click on Display Port.
-----------------------------------------------------------------------------------------------------------------
CONTENT:
I. REFERENCES
II. STEPS - SUMMARY
III. COMMANDS USED
IV. STEPS - BREAKDOWN
-----------------------------------------------------------------------------------------------------------------
I. REFERENCES
-----------------------------------------------------------------------------------------------------------------
II. STEPS - SUMMARY
# 1. SSH into the jump server, Storage Server, App server 1, App server 2, and App server 3 and switch
# to root.
-----------------------------------------------------------------------------------------------------------------
III. STEPS - BREAKDOWN
# My first 1000-point task!
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
sshpass -p '******' ssh -o StrictHostKeyChecking=no [email protected]
sudo su -
******
yum install openssh-clients -y
sudo yum install -y httpd
cd /etc/httpd/conf
grep -n -i listen httpd.conf
sed -i 42s/80/8080/ httpd.conf
grep -n -i listen httpd.conf
systemctl enable httpd && systemctl start httpd && systemctl status httpd
cat /etc/httpd/conf/httpd.conf | grep Listen
vi /etc/httpd/conf/httpd.conf
yum install openssh-clients -y
172.16.238.14
ll /home/thor/ecommerce
ll /home/thor/games
******
******
******
sudo scp -r /home/thor/ecommerce [email protected]:/tmp
sudo scp -r /home/thor/games [email protected]:/tmp
sudo scp -r /home/thor/ecommerce [email protected]:/tmp
sudo scp -r /home/thor/games [email protected]:/tmp
sudo scp -r /home/thor/ecommerce [email protected]:/tmp
sudo scp -r /home/thor/games [email protected]:/tmp
ll /tmp
mv -r /tmp/ecommerce /tmp/games /var/www/html
ll /var/www/html
curl -4 http://stapp01:8080/ecommerce/
curl -4 http://stapp01:8080/games/
curl -4 http://stapp02:8080/ecommerce/
curl -4 http://stapp02:8080/games/
curl -4 http://stapp03:8080/ecommerce/
curl -4 http://stapp03:8080/games/
-----------------------------------------------------------------------------------------------------------------
############################################################################################################
####### ### ### ####### ####### ######### ####### ####### ### ###
#### #### ### ### #### #### #### #### ######### #### #### #### #### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ###
######### ######### #### #### #### #### ######### ######### ######### ### ###
####### ####### ####### ####### ######### ####### ####### ### ###
############################################################################################################
############################################################################################################
######### ##### ### ### ######### ######## ### ##
######### ####### ### ### ######### ######### ### ###
### ### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ### ###
######## ### ### ### ### ######## ### ### ### ###
######## ### ### ### ### ######## ### ### ### ###
### ######### ### ### ### ### ### ### ### ###
### ######### ### ### ### ### ### ### ###
### ### ### ### ######### ######### ######### ### ###
### ### ### ### ######### ######### ######## ### ##
############################################################################################################