1 00:00:01,090 --> 00:00:02,430 What combat. 2 00:00:02,620 --> 00:00:06,490 To recap we've now set up two folders for each of our domains. 3 00:00:06,610 --> 00:00:14,950 We've also created a default HMO file that will load when somebody visits each domain what we need to 4 00:00:14,950 --> 00:00:20,840 do now is set up the new virtual host files for each domain in order for all of this to work. 5 00:00:22,160 --> 00:00:27,440 This way each domain will point to its unique directory and the web page is contained within it. 6 00:00:29,270 --> 00:00:33,790 The default configuration directive for a posh key is located at this path 7 00:00:38,920 --> 00:00:48,000 the default dot com file instructs Apache which directory to serve content from when the server is only 8 00:00:48,000 --> 00:00:52,070 hosting one domain. 9 00:00:52,320 --> 00:01:01,100 We need to make the virtual host file for our first domain since this server will host multiple domains. 10 00:01:01,170 --> 00:01:06,690 After this we'll create a virtual host file for our second and third and fourth and however many domains 11 00:01:06,690 --> 00:01:10,290 you have to do this. 12 00:01:10,300 --> 00:01:14,160 Start by making a new file by typing the following command. 13 00:01:24,450 --> 00:01:27,200 Replace example dot com with your domain name 14 00:01:35,760 --> 00:01:37,490 once you've done that go ahead and press Enter 15 00:01:41,210 --> 00:01:42,900 once you're N.A. text editor. 16 00:01:43,040 --> 00:01:50,750 Take the following text. 17 00:01:50,830 --> 00:01:55,610 There's a few parameters which you'll need to change to reflect your domain name. 18 00:01:58,460 --> 00:02:01,360 So the first one is the e-mail address. 19 00:02:01,400 --> 00:02:09,710 The second is a server name and the server name is just your domain name without the w w w prefix the 20 00:02:09,720 --> 00:02:12,230 server alias is your domain name. 21 00:02:12,240 --> 00:02:14,640 With the w w w prefix 22 00:02:21,030 --> 00:02:23,090 and once you've confirmed that everything is correct. 23 00:02:23,110 --> 00:02:36,210 Go ahead and save the file so control X Y at the prompt and enter. 24 00:02:36,290 --> 00:02:42,880 So once you finish with those modifications you need to enable this file using the following command. 25 00:02:51,170 --> 00:02:55,920 OK I accidentally executed that before I'd made the changes. 26 00:03:00,900 --> 00:03:02,400 So I just typed that in again. 27 00:03:06,000 --> 00:03:08,030 Make sure you replace example dot com 28 00:03:10,920 --> 00:03:12,230 with your domain name. 29 00:03:21,380 --> 00:03:32,260 And press enter. 30 00:03:32,320 --> 00:03:41,750 Once you've done that you'll see the message enabling site displayed and it will also instruct you to 31 00:03:41,840 --> 00:03:48,270 restart Aposhian in order for you to activate this new configuration. 32 00:03:48,330 --> 00:03:50,480 So go ahead and re reload Dabashi 33 00:03:59,900 --> 00:04:01,140 after you typed in this command. 34 00:04:01,140 --> 00:04:01,730 Press Enter 35 00:04:06,110 --> 00:04:11,930 So now that we have our first virtual host file created and enabled we can go ahead and create the second 36 00:04:11,930 --> 00:04:18,020 one the easiest way to do this is by duplicating the first one. 37 00:04:21,130 --> 00:04:25,870 Renaming it and making whatever changes we need to make in the new duplicated file 38 00:04:30,390 --> 00:04:35,420 to do that you're going to take the following command. 39 00:04:37,530 --> 00:04:44,310 Sudo C-p just means copy and then you're instructing on which file you want copied. 40 00:04:44,410 --> 00:04:49,580 So I'm going to copy the file that we already configured 41 00:04:55,240 --> 00:04:58,250 and this is going to be the new duplicated file that's created. 42 00:04:58,300 --> 00:05:01,530 We want the name of this file to be the second domain name 43 00:05:13,340 --> 00:05:26,570 and press enter. 44 00:05:26,580 --> 00:05:28,410 Now let's go ahead and open this file. 45 00:05:28,410 --> 00:05:29,970 The second file we just created 46 00:05:39,040 --> 00:05:40,090 we're opening it in nano 47 00:05:44,600 --> 00:06:25,110 and we'll have to change the parameters this time to match the second domain name. 48 00:06:25,200 --> 00:06:32,680 Again make sure you haven't made any spelling mistakes or typos. 49 00:06:33,210 --> 00:06:35,710 And once you're OK with the changes save the file 50 00:06:39,520 --> 00:06:41,240 type Y and press enter. 51 00:06:46,920 --> 00:06:51,900 Now let's go ahead and enable this configuration that we just created as well. 52 00:06:52,650 --> 00:07:01,750 So we're going to use that same command once again Sudol a to z. 53 00:07:01,780 --> 00:07:03,060 And as I see 54 00:07:05,900 --> 00:07:07,350 some We're doing this secondo me 55 00:07:26,050 --> 00:07:26,770 and press ENTER 56 00:07:33,220 --> 00:07:39,010 So now that we have the two virtual host files created for the two domain names we're going to disable 57 00:07:39,310 --> 00:07:43,380 the default configuration file so type in the following 58 00:07:52,200 --> 00:08:00,720 and press enter. 59 00:08:00,750 --> 00:08:04,800 Now we'll need to reload Aposhian for all these changes to take effect. 60 00:08:10,420 --> 00:08:10,940 Perfect. 61 00:08:10,940 --> 00:08:17,010 We've now created the two virtual host files for each of our two domains and we've enabled them as well. 62 00:08:21,520 --> 00:08:26,800 The next step in this process will be to configure our name servers with our domain name registrar. 63 00:08:27,160 --> 00:08:28,540 So we'll see you in the next less.