1 00:00:00,000 --> 00:00:01,966 [No Audio] 2 00:00:01,966 --> 00:00:06,733 Let's install nginx web server on our local machine. 3 00:00:07,233 --> 00:00:12,300 nginx Web server is the most vanilla example of a web application. 4 00:00:12,300 --> 00:00:16,849 For your information, we are running Ubuntu 16.4 on this 5 00:00:16,849 --> 00:00:20,833 machine and now let's start with switching to the root user 6 00:00:20,833 --> 00:00:25,033 privileges. As you can see, we have moved to root privileges. 7 00:00:25,033 --> 00:00:29,300 Now we can start our installation by first of all, downloading 8 00:00:29,300 --> 00:00:33,733 the PGP or Pretty Good Privacy key for nginx. 9 00:00:33,933 --> 00:00:38,433 The purpose of doing so, is to make sure that when we install 10 00:00:38,433 --> 00:00:43,366 nginx, the binaries are verified, the key has been downloaded. 11 00:00:43,366 --> 00:00:47,066 Now let's switch to etc/apt directory. 12 00:00:47,066 --> 00:00:50,200 With ls command, let's list out the contents. 13 00:00:50,500 --> 00:00:56,833 We have a bunch of files here, but what we need is sources.list file. 14 00:00:57,233 --> 00:01:03,133 So let's open sources.list with Nano text editor. 15 00:01:03,666 --> 00:01:06,933 You can use any text editor you like, but in this course 16 00:01:06,933 --> 00:01:08,833 we will mostly stick to Nano. 17 00:01:08,833 --> 00:01:13,000 As you can see, this file contains a lot of links. 18 00:01:13,000 --> 00:01:17,700 These links are sources for Ubuntu to find updates. 19 00:01:17,700 --> 00:01:21,088 At the end of the file, paste these two lines. 20 00:01:21,088 --> 00:01:25,833 These lines indicate the update path for nginx application 21 00:01:25,833 --> 00:01:29,700 when it gets installed and we update it further in the future. 22 00:01:29,700 --> 00:01:33,140 Let's save the file and exit Nano. 23 00:01:33,140 --> 00:01:34,734 Just to make sure we don't 24 00:01:34,734 --> 00:01:37,300 have any dangling nginx installation, 25 00:01:37,433 --> 00:01:41,466 run 'apt-get remove nginx-common', 26 00:01:41,466 --> 00:01:43,133 this command will make sure 27 00:01:43,133 --> 00:01:47,033 that any of the previously installed instance of nginx installation 28 00:01:47,033 --> 00:01:48,466 is completely removed. 29 00:01:48,466 --> 00:01:53,450 Now let's run 'apt-get update' to reflect the changes we have 30 00:01:53,450 --> 00:01:55,433 made in sources.list file. 31 00:01:56,233 --> 00:01:59,966 Let's use cd command twice to go back where we started. 32 00:01:59,966 --> 00:02:02,166 Now let's install nginx using 33 00:02:02,166 --> 00:02:04,866 'apt-get install nginx' command. 34 00:02:05,100 --> 00:02:09,633 Once the installation is complete, we can verify it by going 35 00:02:09,650 --> 00:02:14,590 to web browser and opening localhost on port 80. 36 00:02:14,590 --> 00:02:17,300 Well, the installation was successful. 37 00:02:17,300 --> 00:02:19,400 nginx is running properly. 38 00:02:19,400 --> 00:02:23,033 This was an example of installing and running 39 00:02:23,033 --> 00:02:27,900 the most simple and vanilla web application, nginx web server.