WEBVTT

00:00.200 --> 00:00.730
Heroine.

00:00.740 --> 00:01.610
And welcome back.

00:01.610 --> 00:07.370
So now that we have our server up and running, the next important and the exciting practical that we'll

00:07.370 --> 00:10.340
be doing is the installation part of Nginx.

00:10.340 --> 00:11.900
So let's get started.

00:11.900 --> 00:14.720
So installing Nginx is very straightforward.

00:14.720 --> 00:20.000
So there are multiple public repositories that are available and you can directly go ahead and install

00:20.000 --> 00:20.810
nginx from them.

00:20.810 --> 00:27.470
So let's assume that you have a specific repository and this repository has the nginx RPM that is available.

00:27.470 --> 00:33.380
So all you need to do is you have to do a Yum install nginx and the Nginx will be installed within your

00:33.380 --> 00:34.310
Linux server.

00:34.310 --> 00:36.530
So this is the high level overview.

00:36.530 --> 00:38.270
So let's quickly try it out.

00:38.270 --> 00:40.370
So I'm connected to a demo server.

00:40.370 --> 00:42.980
So the installation of Nginx is very simple.

00:42.980 --> 00:49.310
All you need to do is you'll have to specify yum, install nginx and it is asking for confirmation.

00:49.310 --> 00:56.090
So let's do a Y to confirm the installation process and that's about it.

00:56.090 --> 01:02.850
So if you quickly want to verify if Nginx is up and running, you can specify systemctl status nginx.

01:03.240 --> 01:11.220
So currently it is showing Nginx is inactive so you can manually start it so you can run systemctl start

01:11.220 --> 01:14.730
nginx and let's quickly verify yet again.

01:14.730 --> 01:18.990
And now you see our nginx is up and running now from the web browser.

01:18.990 --> 01:24.690
Let's also verify if our default nginx page is loading, so I'll copy the public IP of the server and

01:24.690 --> 01:25.800
let's press enter.

01:25.800 --> 01:31.650
Now, if everything is working fine you should see the default nginx page to be up and running over

01:31.650 --> 01:32.070
here.

01:32.070 --> 01:38.010
Now, one important part to note here is that the rock Linux that we are using, it already has one

01:38.010 --> 01:42.930
of the repositories available from which this nginx rpm is being fetched.

01:42.960 --> 01:44.640
Now let me quickly show you.

01:44.640 --> 01:48.270
So if you would have gone a bit up over here.

01:48.300 --> 01:54.690
Here you see the Nginx package is coming from a repository called as Appstream over here.

01:54.690 --> 01:58.740
Now as we are discussing, there are other repositories available as well.

01:58.740 --> 02:04.320
So if you would quickly look into the official website, they have their own set of repositories.

02:04.320 --> 02:06.870
So basically let me quickly show you.

02:06.870 --> 02:12.420
So you have a CentOS repository and if you go a bit down, you also have a Debian Ubuntu repository

02:12.420 --> 02:13.020
over here.

02:13.020 --> 02:16.470
So let's explore the Nginx repository.

02:16.470 --> 02:19.500
So you have version five, version six, version seven and version eight.

02:19.500 --> 02:21.990
So these are basically the CentOS version.

02:22.110 --> 02:29.700
And within here under the RPMs you see you have the RPMs related to the Nginx version.

02:29.700 --> 02:35.760
So you can also if you would want a specific version of Nginx for your environment, you can also use

02:35.760 --> 02:37.050
this specific approach.

02:37.050 --> 02:40.950
Now, the easiest way to do that now let me also show you this.

02:40.950 --> 02:46.020
So currently if I do a nginx hyphen v it shows me a specific version of Nginx.

02:46.020 --> 02:49.620
In this case it is version one point 14.1.

02:49.650 --> 02:55.680
However, if you would like the latest version that was released by Nginx, you can also explore the

02:55.680 --> 03:01.560
Nginx repository which have been officially provided because this is where the latest version usually

03:01.560 --> 03:02.550
comes first.

03:02.550 --> 03:08.130
And from here you can also go ahead and fetch the link of the latest RPM.

03:08.130 --> 03:09.450
Let's copy this up.

03:09.480 --> 03:12.480
You can download that RPM within the server.

03:12.480 --> 03:14.040
So let's do a wget.

03:14.070 --> 03:15.900
Let me paste the RPM here.

03:15.900 --> 03:21.510
So currently the wget command is not found, so let's also go ahead and install wget.

03:22.140 --> 03:24.960
All right, let's download this RPM.

03:26.430 --> 03:27.500
So if I do.

03:27.510 --> 03:34.050
LS so this is the nginx RPM and you can also directly install from this specific nginx rpm.

03:34.050 --> 03:37.920
Let me also show you this so that we have a better clarity here.

03:37.920 --> 03:42.900
So first let's go ahead and remove the nginx that we have installed.

03:47.070 --> 03:47.680
All right.

03:47.680 --> 03:53.310
So we have removed the links and we'll be installing through this specific RPM file.

03:53.320 --> 03:56.740
So I'll specify yum install this time.

03:56.740 --> 04:03.670
You can specify the name of the RPM file here and this time the repository you see it is showing command

04:03.670 --> 04:03.940
line.

04:03.940 --> 04:09.700
I'll specify why and great our nginx is installed.

04:10.630 --> 04:17.200
So if you specify systemctl status nginx it currently is showing inactive or dead.

04:17.200 --> 04:25.960
So let's quickly start our nginx here and let's also do a systemctl enable nginx to ensure that the

04:25.960 --> 04:29.350
nginx automatically starts if we restart the server.

04:29.470 --> 04:36.010
And here if you do a nginx hyphen v you should see that this is a newer version of Nginx which is one

04:36.010 --> 04:37.930
point 20.1.

04:37.930 --> 04:44.680
So now let's also try and refresh this page here and you should see now we have a different default

04:44.680 --> 04:46.700
Nginx page that is available.

04:46.700 --> 04:50.240
So depending upon your choice you can use any one of the methods.

04:50.240 --> 04:55.580
The simplest one, as we were discussing, is you directly run the Yum install nginx command to install

04:55.580 --> 04:56.420
the nginx.

04:56.420 --> 05:01.370
However, for production environments in your organization there is a requirement and there should be

05:01.370 --> 05:06.890
a requirement that all of the servers should use the exact version of Nginx.

05:06.890 --> 05:14.180
So you can download this specific RPM file, you can store it in your organization repository and whenever

05:14.180 --> 05:19.040
you go ahead and do a Yum install, it will only use this specific version.

05:19.040 --> 05:23.810
So multiple approaches depending upon the use cases from your side.

05:23.810 --> 05:25.910
So that's the high level overview.

05:25.910 --> 05:28.130
And with this, we'll conclude today's video.
