-
Notifications
You must be signed in to change notification settings - Fork 95
/
Copy pathTASK_10-Linux_Services.sh
79 lines (54 loc) · 3.8 KB
/
TASK_10-Linux_Services.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
TASK 10 - Linux Services - 2020-07-08 || 05:27 AM
REQUIREMENT:
As per details shared by the development team, the new application release has some dependencies on the back end. There are some packages/services that need to be installed on all app servers under Stratos Datacenter. As per requirements please perform the following steps:
a. Install httpd package on all the application servers.
b. Once installed, make sure it is enabled to start during boot.
-----------------------------------------------------------------------------------------------------------------
CONTENT:
I. REFERENCES
II. STEPS - SUMMARY
III. STEPS - BREAKDOWN
-----------------------------------------------------------------------------------------------------------------
I. REFERENCES
https://community.kodekloud.com/t/linux-services-postfix/6982
https://community.kodekloud.com/t/install-postfix-httpd-task-on-all-application-servers/1100
https://community.kodekloud.com/t/linux-services-task-failed-but-i-did-correct/6952
https://community.kodekloud.com/t/task-status-failed-by-the-system/1173
https://serverfault.com/questions/472145/apache-httpd-not-starting-automatically-on-boot
https://geekflare.com/how-to-auto-start-services-on-boot-in-linux/
-----------------------------------------------------------------------------------------------------------------
II. STEPS - SUMMARY
1. Install httpd package on all the application servers.
2. Once installed, make sure it is enabled to start during boot.
-----------------------------------------------------------------------------------------------------------------
III. STEPS - BREAKDOWN
# This one is a bit easy because it just requires installing a service package onto the app servers.
# The tricky part is that the required package changes everytime I restart the lab.
# I had three attempts on this lab because I wanted to redo the lab in the shortest possible time.
# Each time I redo the lab, i get different packages.
# The first one was NSCD, then POSTFIX, then finally HTTPD which is the one I'm most familiar of.
# So, below are the commands I used for this lab.
# To log in to the three app servers:
sshpass -p '******' ssh -o StrictHostKeyChecking=no tony@172.16.238.10
sshpass -p '******' ssh -o StrictHostKeyChecking=no steve@172.16.238.11
sshpass -p '******' ssh -o StrictHostKeyChecking=no banner@172.16.238.12
sshpass -p '******' ssh -o StrictHostKeyChecking=no peter@172.16.239.10
# To install httpd and make sure that it'll be enable upon bootup:
sudo yum install -y httpd
sudo systemctl enable httpd
sudo systemctl start httpd
sudo systemctl status httpd
systemctl list-unit-files | grep httpd # this may be optional but is also useful
-----------------------------------------------------------------------------------------------------------------
############################################################################################################
####### ### ### ####### ####### ######### ####### ####### ### ###
#### #### ### ### #### #### #### #### ######### #### #### #### #### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
####### ### ### ### ### ######## ####### ####### ### ###
### ### ### ### ### ### ### ### ### ###
### ### ### ### ### ### ### ### ### ### ### ### ###
######### ######### #### #### #### #### ######### ######### ######### ### ###
####### ####### ####### ####### ######### ####### ####### ### ###
############################################################################################################