Here we are going to see how we have set up our master system, we are we are going to implement our
Apache Web server.
What are the different configuration settings that we have made?
And please, if you can yourself implement that lab, then you can skip these videos.
So we are looking at step by step.
So we are looking at how we have configure our master server.
So in this case, what we did, we installed the three VMS and all the three VMS.
By default, the name of the system was localhost.localdomain.
And when we were running the DNS domain name, there was no that it was not showing anything.
So please always remember whenever you are using Linux.
So the first thing is you have to properly name your system.
So first we check the hostname and DNS domain, then with the hostnamectl set-hostname command.
We set the name to master.example.com.
Then we reboot the system or you can log out also and after log out.
what we see that Master name was available.
Then we check with the hostname command.
That name was, it was showing master.example.com.
That is what we wanted.
And when we were running the DNS domain name command it is showing the example.com.
That is also what we want, that name of the domain name to which our system belongs.
It should be example.com.
And then we check initially about our host file.
And please remember initially no entries there by default localhost entries are there, no entry
regarding of this master.example.com.
Then we disabled the firewall by using firewall systemctl disable firewalld command, because
the two firewall services are there.
So we did not wanted to use the firewalld, so we disabled it.
And regarding networking also two services are there, so we disabled this networkmanager service also
by using systemctl disable command, then because we disabled this, we needed the iptables-services
to be available.
So we installed the package yum -q in quiet mode install iptables-services.
If in your case it is not installed, it will ask for the conformation in our case because it was already
installed.
So it said that already installed then we flush the rule and save the rule.
mean that actually by doing this we were effectively able to disable our firewall.
That mean firewall was allowing every traffic, every type of traffic, because here in this course.
we want to concentrate on Apache.
We do not want our firewall or the other security settings to disallow or in any way disturb our Apache
server.
So we have disable this but in production system.
It is not recommended practice.
Then we disable the selinux also by changing the value selinux.
here it was enforcing enforcing.
to be have change it to disabled.
And then we check the IP address, one IP address was given to our machine ip a s ens33 192.
168.142.140.
And please remember, the network setting was NAT always remember when you have to install certain software
in VMS, make the setting as NAT because if the Internet is running on your host operating system,
Internet will run on the your guest machine also in our case, this master VM.
So, because we have to install certain packages.
So we kept it that network adapter.
sorry NAT settings later on when we have install the package, we will change it to the bridge.
Then we check the setting of our ifcfg-ens33 file, how we got that address and please remember
by default, when we check this file, the bootprotocol is dhcp, that mean our system is obtaining
the address automatically and no other setting is there, because once you have set the network adapter setting
to NAT your card LAN card should be set at dhcp that mean it will automatically obtain
That is why it was obtaining this address.
Then what we did, we installed the main package that is Apache Web server package by using the command
yum -q install httpd.
So it is going to install the package.
It will ask for the confirmation we will be saying.
Yes.
So it will install the package.
And if it is already installed, then it will give the message it is already installed and you can confirm
with the rpm -q means query and name of the package whether that package is installed or not.
So we will see whether our package is installed or not.
Then we installed for security because we want to implement https.
Also for that, two packages are required.
openssl, mod_ssl packages are required for it and we install it by using.
yum -q install openssl and mod_ssl and if it is not already installed, it will ask for
the confirmation you have to press y.
Then it will get installed.
If it is already installed, you will get this message that these packages are already installed and
you can confirm with rpm command also rpm query, the name of the package rpm query name of the package.
Then we install certain tools for checking or downloading certain software.
So yum -q in quite mode we install wget utility for downloading the packages elinks.
And Curl Lynx, these are the browser that we are going to use, git is for the if you want to clone
some repository, it is a utility, tree, again, very useful command for displaying the directory structure.
So we are going to install these, these we are going to install almost on all the systems on the client
also.
So it will again ask for the confirmation and we will press.
y.
And if already installed, you're going to get this message.
And with rpm, you can verify each and every package, whether it is installed or not.
So then we because we will be giving a little bit introduction about Lamp stack also linux Apache Mysql
PHP, so we have installed the mariadb-server also, mariadb-server is same as your mysql server.
So but in our case, centos or redhat base system.
They prefer Mariadb server.
So we are going to install Mariadb-server and again, client package mariadb.
This is for your database part again it is going to ask for the confirmation.
We are going to press y and if it is already installed, we will get this message and with the rpm
again you can verify.
Then we are going to install php, php-mysql package also, php for installing php and this is
for connectivity between php and mysql.
Again, if it is not installed, it will ask for the confirmation we are going to press y.
And if it is already installed, it is going to give the message.
After we have install the packages, what we are going to do, we will change our address to the static
for that purpose in which file you are going to make changes.
It is going to be ifcfg-ens33 file here, we are going to change the bootprotocol from static
to sorry, from dynamic to our static.
In our case, the option was dhcp, so we will change it to static and we will make two entries.
ipaddress equal to 172.24.0.1 and netmask is this.
We will change the setting from NAT to bridge and we will say OK, then we will verify that our setting
network adapter is whether NAT or bridge it is showing it is a bridge.
And when we are going to run the ip a s ens33, it is showing that we have got the address 172.24.0.
1 and we are going to make one entry in host file also.
what will be the entry?
It will be your 172.24.0.1 IP address of the system, then fully qualified domain name of the system, master
.example.com then master.
This is entry that we are going to make.
So this is how we have set up our master system.
Let us now verify whether we are having this type of address or not.