1 00:00:01,060 --> 00:00:07,000 Before we can go ahead and configure our virtual hosts file we need to make a directory for each domain 2 00:00:07,000 --> 00:00:14,250 that we want to host on this server to do so we'll use the following command. 3 00:00:14,270 --> 00:00:18,120 This is the make directory command and we need to replace. 4 00:00:18,120 --> 00:00:22,570 Example dot com with our first domain. 5 00:00:22,590 --> 00:00:24,600 Once you've done that go ahead and press enter. 6 00:00:26,520 --> 00:00:29,560 Now we'll need to change the permissions of this directory as well. 7 00:00:29,580 --> 00:00:32,720 But we'll do that in a moment before we do that. 8 00:00:32,730 --> 00:00:37,920 Let's go ahead and make the directory for our second domain as well so that we at least we have our 9 00:00:37,920 --> 00:00:38,880 folders created 10 00:00:49,610 --> 00:00:55,900 and press enter. 11 00:00:55,910 --> 00:01:01,660 So one easy way to administer folders rather than typing in command lines and doing it that way. 12 00:01:02,370 --> 00:01:04,940 Is if you have an agent. 13 00:01:04,960 --> 00:01:08,930 So for example file Zilah or anything like that. 14 00:01:09,310 --> 00:01:18,620 It's a lot easier to just connect to your web server and administer files and folders that way. 15 00:01:19,470 --> 00:01:21,260 So I'm going to go ahead and launch file. 16 00:01:31,690 --> 00:01:34,870 And I'm going to go into my site manager. 17 00:01:35,050 --> 00:01:39,060 Now I already have this server configured here is test. 18 00:01:39,070 --> 00:01:46,480 If you don't just click new site what you're going to select the s FGP method and make sure you don't 19 00:01:46,480 --> 00:01:51,420 select FTB select as FTB for the hostname. 20 00:01:51,420 --> 00:01:54,540 You're gonna need your floating IP address. 21 00:01:54,540 --> 00:02:00,030 So go back to Digital Ocean and just copy this IP address your 22 00:02:04,540 --> 00:02:14,900 and enter your IP address next to the host Leavell for log on type select normal. 23 00:02:15,100 --> 00:02:22,740 You're going to log in as root user and type in your password that you selected when you initially deployed 24 00:02:22,740 --> 00:02:25,320 your droplet and then quick connect 25 00:02:29,190 --> 00:02:33,060 OK you're going to receive a messages saying the servers host he is unknown. 26 00:02:33,120 --> 00:02:34,590 Just go ahead and click OK. 27 00:02:38,300 --> 00:02:39,600 Now you're going to scroll up. 28 00:02:39,600 --> 00:02:43,980 So just double click this folder here. 29 00:02:45,640 --> 00:02:49,400 And once you've gone up one directory you're going to go in the var directory. 30 00:02:50,120 --> 00:02:54,570 And then the w w w directory. 31 00:02:54,770 --> 00:03:01,610 So as you can see we have the two folders we just created this is the first domain and the second domain 32 00:03:04,660 --> 00:03:12,020 and what we're going to do is we're going to reset the permissions for both of these domains so to do 33 00:03:12,020 --> 00:03:17,710 that right click on each domain and go to file permissions. 34 00:03:17,800 --> 00:03:19,530 Make sure that it's 7 5:5. 35 00:03:19,540 --> 00:03:20,560 In this case it is. 36 00:03:20,560 --> 00:03:28,240 So there's nothing left to change their And the second one should be the same. 37 00:03:28,530 --> 00:03:29,390 7 5 5. 38 00:03:29,400 --> 00:03:31,160 OK that's perfect. 39 00:03:31,200 --> 00:03:36,420 Now what we're going to do is create an HMO folder inside each one of these directories. 40 00:03:36,420 --> 00:03:44,700 So when you click on this first directory and I'm going to right click and select Create directory type 41 00:03:44,700 --> 00:03:48,320 in each DML. 42 00:03:48,540 --> 00:03:51,330 Just check to make sure that the file permissions are correct. 43 00:03:53,210 --> 00:04:09,250 Type in 7 5 5 and press OK now go up go into the second domain directory and create a folder called 44 00:04:09,300 --> 00:04:23,010 HDMI again and again set the file permissions. 45 00:04:23,350 --> 00:04:27,270 OK so perfect we now have our two domains. 46 00:04:27,930 --> 00:04:33,070 If you have other domains you'd like to add you can go ahead and repeat that step for each domain that 47 00:04:33,070 --> 00:04:36,580 you'd like hosted on the server. 48 00:04:36,580 --> 00:04:42,940 Now if you do have a number of domains here you're probably going to just want to set the permissions 49 00:04:42,940 --> 00:04:52,650 for the entire w w w directory for now and then as you build your web content you can always set up 50 00:04:52,770 --> 00:04:57,710 individual file and folder permissions separately. 51 00:04:57,810 --> 00:05:03,550 But if you're dealing with a lot of domains just right click on your w WW folder go to file permissions 52 00:05:04,980 --> 00:05:10,830 and what you can do is place a checkmark in this box your recurse into subdirectories. 53 00:05:10,830 --> 00:05:18,120 So what will happen there is every single folder inside the w w w directory will also have the same 54 00:05:18,120 --> 00:05:20,140 permissions that you establish here. 55 00:05:21,590 --> 00:05:26,420 So go ahead and click OK. 56 00:05:26,520 --> 00:05:31,810 And so that yeah that's a lot a lot faster if you're dealing with many different domains. 57 00:05:31,920 --> 00:05:39,100 So here we are back in terminal and the next thing we need to do here is create the default indexed 58 00:05:39,230 --> 00:05:43,980 h DML file that will load when somebody visits each domain. 59 00:05:44,230 --> 00:05:51,970 So each domain would need its own separate index dot each DML file which is relevant to that domain. 60 00:05:54,170 --> 00:05:58,370 So we can go ahead and create this file in nano text editor. 61 00:05:58,620 --> 00:06:01,560 So just paste in the following command here. 62 00:06:08,010 --> 00:06:11,870 Make sure that you replace example dot com with your domain name. 63 00:06:12,030 --> 00:06:19,490 Will do one domain at a time so you can start with the first one and then move onto the second and press 64 00:06:19,520 --> 00:06:20,330 enter. 65 00:06:27,340 --> 00:06:32,310 Now inside this file you'll need to paste in the following code. 66 00:06:44,710 --> 00:06:49,630 So it's just a basic DML page and the title for the first page is. 67 00:06:49,630 --> 00:06:51,960 Welcome to domain 1. 68 00:06:51,970 --> 00:06:54,830 Now you can replace domain one with your actual domain name 69 00:07:00,220 --> 00:07:01,710 and in the body. 70 00:07:01,720 --> 00:07:09,620 We're just going to have success domain one is configured correctly and you want to save this file by 71 00:07:09,620 --> 00:07:16,920 pressing control X type Y if the prompt and press enter. 72 00:07:17,280 --> 00:07:25,120 Now let's go ahead and create the index dot h d m l file for our second domain so use nano again. 73 00:07:25,320 --> 00:07:30,050 All you need to do is change your domain name in the command to your second domain 74 00:07:35,380 --> 00:07:38,420 and press enter. 75 00:07:38,690 --> 00:07:47,840 Be careful not to be careful to avoid any typos any spelling mistakes in the domain names or folder 76 00:07:47,840 --> 00:07:50,020 names will cause issues later on. 77 00:07:51,860 --> 00:07:56,750 So press enter and just paste again. 78 00:08:03,760 --> 00:08:04,650 And this time I'm going to put. 79 00:08:04,650 --> 00:08:06,210 Welcome to domain to 80 00:08:09,760 --> 00:08:13,150 and success domain to is configured correctly. 81 00:08:16,210 --> 00:08:17,620 Now save this file. 82 00:08:20,970 --> 00:08:24,900 Enter OK and we'll see you in the next lecture.