1
00:00:00,610 --> 00:00:06,100
Here we are going to see how we have set up our master system, we are we are going to implement our

2
00:00:06,100 --> 00:00:07,180
Apache Web server.

3
00:00:07,630 --> 00:00:11,590
What are the different configuration settings that we have made?

4
00:00:12,100 --> 00:00:18,820
And please, if you can yourself implement that lab, then you can skip these videos.

5
00:00:19,090 --> 00:00:20,870
So we are looking at step by step.

6
00:00:21,040 --> 00:00:24,470
So we are looking at how we have configure our master server.

7
00:00:25,090 --> 00:00:31,850
So in this case, what we did, we installed the three VMS and all the three VMS.

8
00:00:32,050 --> 00:00:37,230
By default, the name of the system was localhost.localdomain.

9
00:00:37,810 --> 00:00:44,830
And when we were running the DNS domain name, there was no that it was not showing anything.

10
00:00:45,310 --> 00:00:48,940
So please always remember whenever you are using Linux.

11
00:00:48,950 --> 00:00:52,770
So the first thing is you have to properly name your system.

12
00:00:53,200 --> 00:01:00,520
So first we check the hostname and DNS domain, then with the hostnamectl set-hostname command.

13
00:01:00,880 --> 00:01:03,640
We set the name to master.example.com.

14
00:01:04,330 --> 00:01:09,190
Then we reboot the system or you can log out also and after log out.

15
00:01:09,490 --> 00:01:13,600
what we see that Master name was available.

16
00:01:13,720 --> 00:01:15,770
Then we check with the hostname command.

17
00:01:17,140 --> 00:01:20,460
That name was, it was showing master.example.com.

18
00:01:20,470 --> 00:01:21,640
That is what we wanted.

19
00:01:22,150 --> 00:01:26,770
And when we were running the DNS domain name command it is showing the example.com.

20
00:01:27,460 --> 00:01:33,210
That is also what we want, that name of the domain name to which our system belongs.

21
00:01:33,220 --> 00:01:34,630
It should be example.com.

22
00:01:35,470 --> 00:01:39,760
And then we check initially about our host file.

23
00:01:40,030 --> 00:01:47,480
And please remember initially no entries there by default localhost entries are there, no entry

24
00:01:47,480 --> 00:01:50,320
regarding of this master.example.com.

25
00:01:52,000 --> 00:02:00,790
Then we disabled the firewall by using firewall systemctl disable firewalld command, because

26
00:02:00,790 --> 00:02:03,050
the two firewall services are there.

27
00:02:03,340 --> 00:02:07,240
So we did not wanted to use the firewalld, so we disabled it.

28
00:02:07,690 --> 00:02:15,130
And regarding networking also two services are there, so we disabled this networkmanager service also

29
00:02:15,130 --> 00:02:23,740
by using systemctl disable command, then because we disabled this, we needed the iptables-services

30
00:02:24,970 --> 00:02:25,930
to be available.

31
00:02:26,320 --> 00:02:32,710
So we installed the package yum -q in quiet mode install iptables-services.

32
00:02:33,970 --> 00:02:40,570
If in your case it is not installed, it will ask for the conformation in our case because it was already

33
00:02:40,570 --> 00:02:40,960
installed.

34
00:02:40,960 --> 00:02:46,040
So it said that already installed then we flush the rule and save the rule.

35
00:02:46,040 --> 00:02:52,840
mean that actually by doing this we were effectively able to disable our firewall.

36
00:02:53,230 --> 00:03:03,110
That mean firewall was allowing every traffic, every type of traffic, because here in this course.

37
00:03:03,110 --> 00:03:05,430
we want to concentrate on Apache.

38
00:03:05,770 --> 00:03:13,480
We do not want our firewall or the other security settings to disallow or in any way disturb our Apache

39
00:03:13,480 --> 00:03:13,890
server.

40
00:03:14,410 --> 00:03:18,880
So we have disable this but in production system.

41
00:03:18,880 --> 00:03:20,440
It is not recommended practice.

42
00:03:21,910 --> 00:03:28,840
Then we disable the selinux also by changing the value selinux.

43
00:03:28,990 --> 00:03:32,230
here it was enforcing enforcing.

44
00:03:32,230 --> 00:03:34,480
to be have change it to disabled.

45
00:03:36,230 --> 00:03:47,000
And then we check the IP address, one IP address was given to our machine ip a s ens33 192.

46
00:03:47,000 --> 00:03:51,970
168.142.140.

47
00:03:52,190 --> 00:03:58,790
And please remember, the network setting was NAT always remember when you have to install certain software

48
00:03:59,060 --> 00:04:06,680
in VMS, make the setting as NAT because if the Internet is running on your host operating system,

49
00:04:06,860 --> 00:04:13,240
Internet will run on the your guest machine also in our case, this master VM.

50
00:04:14,090 --> 00:04:19,220
So,      because we have to install certain packages.

51
00:04:19,520 --> 00:04:22,160
So we kept it that network adapter.

52
00:04:22,520 --> 00:04:28,700
  sorry NAT settings later on when we have install the package, we will change it to the bridge.

53
00:04:31,280 --> 00:04:41,630
Then we check the setting of our ifcfg-ens33 file, how we got that address and please remember

54
00:04:41,630 --> 00:04:50,390
by default, when we check this file, the bootprotocol is dhcp, that mean our system is obtaining

55
00:04:50,390 --> 00:04:58,610
the address automatically and no other setting is there, because once you have set the network adapter setting

56
00:04:58,610 --> 00:05:08,190
to NAT your card LAN card should be set at dhcp that mean it will automatically obtain

57
00:05:08,450 --> 00:05:10,750
That is why it was obtaining this address.

58
00:05:11,540 --> 00:05:19,640
Then what we did, we installed the main package that is Apache Web server package by using the command

59
00:05:19,850 --> 00:05:21,200
yum -q install httpd.

60
00:05:22,460 --> 00:05:24,380
So it is going to install the package.

61
00:05:24,560 --> 00:05:27,830
It will ask for the confirmation we will be saying.

62
00:05:27,830 --> 00:05:28,400
Yes.

63
00:05:28,550 --> 00:05:30,230
So it will install the package.

64
00:05:31,400 --> 00:05:38,480
And if it is already installed, then it will give the message it is already installed and you can confirm

65
00:05:38,480 --> 00:05:44,730
with the rpm -q means query and name of the package whether that package is installed or not.

66
00:05:45,080 --> 00:05:49,200
So we will see whether our package is installed or not.

67
00:05:49,940 --> 00:05:53,810
Then we installed for security because we want to implement https.

68
00:05:53,840 --> 00:05:56,480
Also for that, two packages are required.

69
00:05:56,510 --> 00:06:03,290
openssl, mod_ssl packages are required for it and we install it by using.

70
00:06:03,290 --> 00:06:12,580
yum -q install openssl and mod_ssl and if it is not already installed, it will ask for

71
00:06:12,590 --> 00:06:15,290
the confirmation you have to press y.

72
00:06:15,710 --> 00:06:17,270
Then it will get installed.

73
00:06:17,750 --> 00:06:23,840
If it is already installed, you will get this message that these packages are already installed and

74
00:06:23,840 --> 00:06:30,590
you can confirm with rpm command also rpm query, the name of the package rpm query name of the package.

75
00:06:32,030 --> 00:06:36,830
Then we install certain tools for checking or downloading certain software.

76
00:06:37,220 --> 00:06:45,780
So yum -q in quite mode we install wget utility for downloading the packages elinks.

77
00:06:46,990 --> 00:06:55,750
And Curl Lynx, these are the browser that we are going to use, git is for the if you want to clone

78
00:06:55,750 --> 00:07:03,830
some repository, it is a utility, tree, again, very useful command for displaying the directory structure.

79
00:07:03,970 --> 00:07:12,160
So we are going to install these, these we are going to install almost on all the systems on the client

80
00:07:12,160 --> 00:07:12,540
also.

81
00:07:13,120 --> 00:07:17,440
So it will again ask for the confirmation and we will press.

82
00:07:17,500 --> 00:07:17,870
y.

83
00:07:18,810 --> 00:07:23,760
And if already installed, you're going to get this message.

84
00:07:24,160 --> 00:07:28,930
And with rpm, you can verify each and every package, whether it is installed or not.

85
00:07:30,810 --> 00:07:38,640
So then we because we will be giving a little bit introduction about Lamp stack also linux Apache Mysql 

86
00:07:39,030 --> 00:07:48,730
PHP, so we have installed the mariadb-server also, mariadb-server is same as your mysql server.

87
00:07:49,200 --> 00:07:55,220
So but in our case, centos or redhat base system.

88
00:07:55,230 --> 00:07:59,240
They prefer Mariadb server.

89
00:07:59,640 --> 00:08:05,940
So we are going to install Mariadb-server and again, client package mariadb.

90
00:08:06,270 --> 00:08:11,730
This is for your database part again it is going to ask for the confirmation.

91
00:08:11,730 --> 00:08:19,320
We are going to press y and if it is already installed, we will get this message and with the rpm

92
00:08:19,320 --> 00:08:20,210
again you can verify.

93
00:08:21,000 --> 00:08:28,440
Then we are going to install php, php-mysql package also, php for installing php and this is

94
00:08:28,440 --> 00:08:31,470
for connectivity between php and mysql.

95
00:08:31,770 --> 00:08:36,210
Again, if it is not installed, it will ask for the confirmation we are going to press y.

96
00:08:36,600 --> 00:08:40,110
And if it is already installed, it is going to give the message.

97
00:08:40,710 --> 00:08:47,550
After we have install the packages, what we are going to do, we will change our address to the static

98
00:08:47,970 --> 00:08:51,090
for that purpose in which file you are going to make changes.

99
00:08:51,280 --> 00:08:59,040
It is going to be ifcfg-ens33 file here, we are going to change the bootprotocol from static

100
00:08:59,040 --> 00:09:04,320
to sorry, from dynamic to our static.

101
00:09:04,320 --> 00:09:12,150
In our case, the option was dhcp, so we will change it to static and we will make two entries.

102
00:09:12,300 --> 00:09:18,180
ipaddress equal to 172.24.0.1 and netmask is this.

103
00:09:19,720 --> 00:09:30,430
We will change the setting from NAT to bridge and we will say OK, then we will verify that our setting

104
00:09:30,430 --> 00:09:35,280
network adapter is whether NAT or bridge it is showing it is a bridge.

105
00:09:35,620 --> 00:09:44,830
And when we are going to run the ip a s ens33, it is showing that we have got the address 172.24.0.

106
00:09:44,830 --> 00:09:48,210
1 and we are going to make one entry in host file also.

107
00:09:48,310 --> 00:09:49,390
what will be the entry?

108
00:09:49,960 --> 00:09:58,890
It will be your 172.24.0.1 IP address of the system, then fully qualified domain name of the system, master

109
00:09:59,170 --> 00:10:00,610
.example.com then master.

110
00:10:00,910 --> 00:10:02,830
This is entry that we are going to make.

111
00:10:03,370 --> 00:10:06,590
So this is how we have set up our master system.

112
00:10:06,650 --> 00:10:12,070
Let us now verify whether we are having this type of address or not.
